Uh oh!
There was an error while loading. Please reload this page.
Auto-bump version when release tag already exists - #31592
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…rror message Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
This PR aims to prevent release workflow reruns from hard-failing when the intended release tag already exists (e.g., after a prior run pushed the tag but failed mid-run), by introducing a retry loop that bumps the version and rechecks for tag availability.
Changes:
- Added a
tagExists(tagName)helper to detect existing tags via both GitHub releases and git refs. - Replaced the “tag already exists” hard-failure with a bounded retry loop that bumps the version and retries (up to 10 attempts).
- Added explicit
switchcases to define bump behavior byrelease_type.
Show a summary per file
| File | Description |
|---|---|
| .github/workflows/release.md | Adds tag-existence checks + retry/bump loop to avoid failing reruns when a tag already exists. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
| // Helper: check whether a given tag already exists (as a release or git ref) | ||
| const tagExists = async (tagName) => { | ||
| const releaseExists = releases.some(r => r.tag_name === tagName); | ||
| if (releaseExists) return true; | ||
| try { |
pelikhan
commented
May 11, 2026
@copilot merge main and recompile |
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/810b4de7-3401-41b3-a103-216d51e80760 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
…e-config-for-version-bumping # Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit. Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Agent-Logs-Url: https://github.com/github/gh-aw/sessions/810b4de7-3401-41b3-a103-216d51e80760 Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Done. Merged main (commit Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Bug Fix
What was the bug?
When a release fails mid-run after the git tag is pushed, re-running the workflow hard-fails with "tag already exists" — requiring manual tag deletion before retrying.
How did you fix it?
Replace the hard failure with a retry loop in the Compute Release Config step. On each iteration, the loop checks both the GitHub releases list and raw git refs; if the computed tag is taken, it bumps the version and tries again (up to 10 attempts).
tagExists(tagName)— helper that checks GitHub releases and git refs, with a descriptive error on unexpected API failurespatchfor patch releases,minorfor minor/major releases, logging each skipped versionswitch— separate cases forpatch,minor, andmajorto make bump behaviour unambiguous