fix(ci): gate krew-release-bot on final release tags only#2107
Merged
Conversation
Copilot
AI
changed the title
[WIP] Fix krew-release action for pre-releases
Do not run krew-release action on pre-releases
Mar 11, 2026
rbtr
reviewed
Mar 11, 2026
rbtr
approved these changes
Mar 11, 2026
Retina Code Coverage ReportTotal coverage no changeIncreased diff
|
Member
|
@copilot commits must have verified signatures |
Contributor
Author
Commit signing requires a GPG/SSH private key in the git environment. As a Copilot agent, I don't have access to signing keys — the |
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 <nguyenquang@microsoft.com> Signed-off-by: Quang Nguyen <nguyenquang@microsoft.com>
4968f9e to
448b6ea
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
krew-release-botstep was triggering on all tag pushes (v*), including pre-release tags likev1.0.0-alpha.1andv1.0.0-rc.1, spamming krew-index with spurious PRs.Description
.github/workflows/goreleaser.yaml: Added a "Check if release tag" step that uses bash to match the tag against the regex^v[0-9]+\.[0-9]+\.[0-9]+$and sets a step output. The krew-release-bot step is then gated on that output, so it only runs on final release tags and skips pre-release tags.GitHub Actions expressions do not support regex natively, so a dedicated bash step is used to perform the regex match and expose the result as a step output. This does not affect the rest of the
releasejob (binary builds, GoReleaser, etc.), which will continue to run on all tag pushes.Related Issue
Resolves the krew-index spam reported in the issue.
Checklist
git commit -S -s ...). See this documentation on signing commits.Screenshots (if applicable) or Testing Completed
N/A — workflow-only change; can be validated by pushing a pre-release tag and confirming the krew step is skipped.
Additional Notes
This does not affect the rest of the
releasejob (binary builds, GoReleaser, etc.), which will continue to run on all tag pushes.Original prompt
🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.