fix: skip the release when nothing changed - #103
Merged
Conversation
The cron released the same tree over and over. v1.10.0 and v1.11.0 hold the same code. This repository set `default_bump: minor` on `mathieudutour/github-tag-action`. Any value other than `false` makes the action bump the version on every run, even when no commit landed since the last tag. This change: * sets `default_bump: false`; * guards the release steps on `tag_version.outputs.new_tag != ''`; * guards the `build` and `release` jobs on `needs.tag.outputs.new_tag != ''`. Note that this changes more here than in the other repositories of this sweep. A commit whose title is not a conventional commit used to produce a minor release, and now produces none. Use `feat:` for a minor release and `fix:` for a patch release. This commit has been created by an automated coding assistant, with human supervision. Prompt used to generate this commit: when done: check all my GitHub repos, and if any have defined BCR and private registry publication workflows, send PRs to modify workflows to *skip* publication if no changes
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 problem
The cron releases the same tree over and over. v1.10.0 and v1.11.0 hold the
same code.
The workflow lives in
release.ymlhere, not intag-and-release.yml, but thecause is the same
mathieudutour/github-tag-action.Read this part before you merge
This repository is the one case in the sweep where the change is not purely
mechanical. Your workflow sets
default_bump: minoron purpose. I changed itto
false.Any value other than
falsemakes the action bump the version on everyrun, even with no new commit, so no guard can ever work while
minorstands.But the change has a cost: a commit whose title is not a conventional commit
used to produce a minor release here, and now produces none. Use
feat:for aminor release and
fix:for a patch release.If you would rather keep
minor, close this pull request. The guards alonecannot help while it is set.
The change
default_bump: minorbecomesdefault_bump: false.tag_version.outputs.new_tagis notempty.
buildandreleasejobs now run only whenneeds.tag.outputs.new_tagis not empty.
Summary of commits
fix: skip the release when nothing changed— edits.github/workflows/release.ymlonly. 1 file changed.Verification
A script added the guards, and I changed
default_bumpby hand. The scriptdeclines to overwrite a
default_bumpthat is already set, which is why itneeded the hand edit.
I then parsed the result with
yaml.safe_loadand checked thatdefault_bumpis
false, that no release step is left unguarded, and that both job guardsname
new_tag, which is the output thistagjob declares.This pull request has been created by an automated coding assistant, with
human supervision.
Prompt used to generate this pull request:
when done: check all my GitHub repos, and if any have defined BCR and private registry publication workflows, send PRs to modify workflows to skip publication if no changes