Skip the GitHub release when it already exists (fixes 422 on every merge to main) - #30
Merged
Merged
Conversation
The Bump version workflow pins custom_tag to 1.2.0. Every push to main that does not raise it makes ncipollo/release-action try to create the existing v1.2.0 release again, and the run fails with 422 already_exists. github-tag-action already skips the existing tag; skipIfReleaseExists makes the release step skip the existing release the same way. Raising custom_tag still creates the new tag and release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Summary
The Bump version workflow (
.github/workflows/bump-version.yml) fails on every push tomainthat does not raisecustom_tag. The latest failure is run 36558608331, from the merge of #27. The release step fails with:custom_tagis pinned to1.2.0, and thev1.2.0tag and release already exist. The merge of #22 created them on 2026-09-03.mathieudutour/github-tag-actionsets its outputs (new_tag: v1.2.0,changelog). It then skips creating the existing tag and exits 0.ncipollo/release-actionthen tries to create thev1.2.0release again and fails with the 422 above.Every merge since #18 has failed this way (#18, #23, #21, #24, #25, #29, #27), except #22, which raised
custom_tagto1.2.0. #29 listed this as out of scope for a separate PR.This PR sets
skipIfReleaseExists: true. The release step now skips an existing release, just as the tag step already skips an existing tag. Raisingcustom_tagstill creates the new tag and release, so the manual release process does not change.Changes
.github/workflows/bump-version.ymlonly (+1 line):body: ${{ steps.tag_version.outputs.changelog }} + skipIfReleaseExists: trueChecked against the source of the pinned actions:
ncipollo/release-action@339a818(v1.21.0)action.yml:110defines the input: "When skipIfReleaseExists is enabled the action will be skipped if a non-draft release already exists for the provided tag."src/ActionSkipper.ts:14-27looks up the release by tag and skips only when one is returned. Any error, including a 404, means "don't skip". The check therefore cannot fail the step by itself; at worst the run fails the same way it does today.src/Action.ts:45-47emits the noticeSkipping action, release already exists and skipIfReleaseExists is enabled.and returns, so the step succeeds.src/Inputs.ts:187-189reads the input withcore.getBooleanInput, so the value is the YAML booleantrue.mathieudutour/github-tag-action@af99e60(v7.0.0)src/action.ts:213-243sets the outputs first and skipscreateTagwhen the tag already exists.tag: v1.2.0, and the new flag decides whether it creates a release.Impact
new_tag. In that case it now skips instead of failing.custom_tagis ever set by mistake to a version that already has a release, the run no longer fails loudly with 422. It succeeds, and only the notice above appears.tests.ymlare unchanged.Verification
.github/workflows/bump-version.yml: no findings (exit 0).YAML.load_file: the release step'swithcontains"skipIfReleaseExists" => true(TrueClass).git diff origin/mainis the one added line and nothing else.v1.2.0is a published release (draft: false, published 2026-09-03), so the next run will take the skip path.pushtomain, so it cannot run on this PR, and theTestschecks here do not exercise it.Post-merge QA
On the Bump version run for this PR's merge commit:
Bump version and push tagsucceeds without creating a new tag (custom_tagis still1.2.0)Create a GitHub releasesucceeds with the noticeSkipping action, release already exists and skipIfReleaseExists is enabled.successgh release listshows no new release (the latest is stillv1.2.0)custom_tagis raised, the new release is actually createdOut of scope
custom_tagis maintained, or going back to automatic version bumpspermissions: contents: writefor this workflowtests.ymlcomposer in /appDependabot security update job (Drop cakephp/cakephp from the app skeleton to stop recurring Dependabot failures #31)🤖 Generated with Claude Code