From 448b6ea7c1968bbcf90c9be5cbb03f3fbeb5e674 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Fri, 20 Mar 2026 20:17:11 +0000 Subject: [PATCH] fix(ci): gate krew-release-bot on final release tags only The krew-release-bot step was triggering on all tag pushes (v*), including pre-release tags like v1.0.0-alpha.1, spamming krew-index with spurious PRs. Add a regex check step that only allows the krew step to run on final release tags matching ^v[0-9]+\.[0-9]+\.[0-9]+$. Fixes #2106 Co-authored-by: Quang Nguyen Signed-off-by: Quang Nguyen --- .github/workflows/goreleaser.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/goreleaser.yaml b/.github/workflows/goreleaser.yaml index 1265e0ab6d..4e521a7586 100644 --- a/.github/workflows/goreleaser.yaml +++ b/.github/workflows/goreleaser.yaml @@ -63,6 +63,14 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} MCR_AGENT_IMAGE_NAME: mcr.microsoft.com/containernetworking/retina-agent + - name: Check if release tag + id: check-tag + run: | + if [[ "${{ github.ref_name }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "is_release=true" >> $GITHUB_OUTPUT + else + echo "is_release=false" >> $GITHUB_OUTPUT + fi - name: Update new version in krew-index - if: github.repository_owner == 'microsoft' + if: github.repository_owner == 'microsoft' && steps.check-tag.outputs.is_release == 'true' uses: rajatjindal/krew-release-bot@c970b8a8f6dbc2f2285a26e3ae160903b87002c3 # v0.0.51