ci: allow manually dispatching the release workflow - #3
Merged
Conversation
Lets a release be published without needing tag-push permission on the git remote: workflow_dispatch takes the version as an input, and the release step falls back to it when the run wasn't triggered by an actual tag push (github.ref_name would otherwise be the branch name).
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
.github/workflows/release.yml) only triggered onpush: tags: v*. This session's git write access doesn't have permission to push tags (only to its assigned branch), so there was no way to cut a release without a maintainer pushing the tag manually.workflow_dispatchtrigger with a requiredversioninput (e.g.v1.1.0). The release job falls back togithub.event.inputs.versionwhen the run wasn't triggered by an actual tag push (in which casegithub.ref_nameis a branch name, not a tag), and passes it explicitly astag_name/nametosoftprops/action-gh-release— which creates the tag pointing at the dispatched ref if it doesn't already exist.v*tag still works exactly as before.Changes
.github/workflows/release.yml: addedworkflow_dispatch.inputs.version, aDetermine release tagstep, and passed the resolved tag astag_name/nameto the release step.Test plan
python3 -c "import yaml; yaml.safe_load(open('.github/workflows/release.yml'))".version: v1.1.0againstmainand confirm it publishes av1.1.0release with all three platform binaries attached.