Create GitHub releases when tagging#244
Open
Rumbles wants to merge 1 commit into
Open
Conversation
The tag workflow currently creates and pushes git tags but never creates corresponding GitHub Releases. This makes the repo incompatible with Renovate (and similar tools), which uses GitHub Releases for action version lookups. See databricks#182. Changes: - Add `permissions: contents: write` so GITHUB_TOKEN can create releases. - Use `gh release create --target <sha>` to create the release; this also creates the tag if missing, so we no longer need a separate `git tag` + `git push --tags` step. - Gate the loop on release existence (`gh release view`) rather than tag existence. This makes the workflow idempotent: a partial failure on a previous run is reconciled, and pre-existing tags that lack a release are backfilled on the next run. - Walk commits in chronological order (`--reverse`) so each release's auto-generated notes diff against the previous release. - Use full commit SHAs (`%H`) for `--target` correctness.
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
Closes #182.
The
tagworkflow currently creates and pushes git tags but never creates the corresponding GitHub Releases. As reported in #182, this makes the repo incompatible with Renovate and similar tools that use the GitHub Releases API for action version discovery.This PR fixes that by having the workflow create a GitHub Release for each new version, with a few additional robustness improvements over #183:
Changes
permissions: contents: writeat the workflow level — required forGITHUB_TOKENto create releases (and tags). Without this, the release step fails with 403 in repos whose default token permissions are read-only.git tag+git push --tagsstep withgh release create --target <sha>—gh release createcreates the tag if it doesn't already exist, so a single command handles both.gh release view "$tag"succeeds. This makes the workflow:v1.0.0) that lack a release will get one on the next run, so Renovate users don't have to wait for the next version bump to start working.git log --reverse) so each release's auto-generated notes diff against the previous release rather than against an arbitrary newer one.%Hinstead of%h) for--targetcorrectness.Test plan
workflow_dispatchon a branch and verify the existing tags get GitHub Releases created (backfill).VERSIONbump and verify the new tag and release are both created in a single workflow run.gh api repos/databricks/setup-cli/releases) now returns the releases.