From e65b65b490912781dbf9aacbc30ff225805f5e3a Mon Sep 17 00:00:00 2001 From: Zhiwei Yin Date: Mon, 9 Mar 2026 10:32:17 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=8C=B1=20Replace=20deprecated=20kubebuild?= =?UTF-8?q?er-release-tools=20PR=20verifier=20with=20inline=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Docker image gcr.io/kubebuilder/pr-verifier:v0.4.3 used by kubernetes-sigs/kubebuilder-release-tools has been removed from GCR as of March 2025. Replace it with an inline shell script that validates PR title format, following the approach adopted by the Kubebuilder project itself. Co-Authored-By: Claude Opus 4.6 (1M context) Signed-off-by: Zhiwei Yin --- .github/workflows/pr-verify.yml | 34 +++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.github/workflows/pr-verify.yml b/.github/workflows/pr-verify.yml index fbe79ca70..049db4221 100644 --- a/.github/workflows/pr-verify.yml +++ b/.github/workflows/pr-verify.yml @@ -1,11 +1,7 @@ name: PR Verifier on: - # NB: using `pull_request_target` runs this in the context of - # the base repository, so it has permission to upload to the checks API. - # This means changes won't kick in to this file until merged onto the - # main branch. - pull_request_target: + pull_request: types: [opened, edited, reopened, synchronize] permissions: @@ -14,13 +10,27 @@ permissions: jobs: verify: name: verify PR contents - permissions: - checks: write - pull-requests: read runs-on: ubuntu-latest steps: - name: Verifier action - id: verifier - uses: kubernetes-sigs/kubebuilder-release-tools@v0.4.3 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} + env: + TITLE: ${{ github.event.pull_request.title }} + run: | + if [[ -z "$TITLE" ]]; then + echo "Error: PR title cannot be empty." + exit 1 + fi + + if ! [[ "$TITLE" =~ ^($'\u26A0'|$'\u2728'|$'\U0001F41B'|$'\U0001F4D6'|$'\U0001F680'|$'\U0001F331') ]]; then + echo "Error: Invalid PR title format." + echo "Your PR title must start with one of the following indicators:" + echo "- Breaking change: ⚠ (U+26A0)" + echo "- Non-breaking feature: ✨ (U+2728)" + echo "- Patch fix: 🐛 (U+1F41B)" + echo "- Docs: 📖 (U+1F4D6)" + echo "- Release: 🚀 (U+1F680)" + echo "- Infra/Tests/Other: 🌱 (U+1F331)" + exit 1 + fi + + echo "PR title is valid: '$TITLE'"