Enable releases from GitHub Actions - #60
Conversation
| version_pattern='^v[0-9]+\.[0-9]+\.[0-9]+(-[0-9A-Za-z][0-9A-Za-z.-]*)?$' | ||
| stable_pattern='^v[0-9]+\.[0-9]+\.[0-9]+$' | ||
| rc_pattern='^v[0-9]+\.[0-9]+\.[0-9]+-rc\.[1-9][0-9]*$' |
There was a problem hiding this comment.
[P2] Reject noncanonical SemVer before the workflow creates the tag
publish-rc accepts v01.2.3-rc.1, and promote-stable accepts v01.2.3. These values have leading zeros and are not canonical SemVer.
Release Drafter first uses strict parse(). If that function fails, it uses coerce(), which changes 01.2.3-rc.1 to 1.2.3.
The workflow creates the protected tag before Release Drafter runs. Release Drafter then writes VERSION=v1.2.3 in the release notes. The later check expects VERSION=v01.2.3-rc.1 and fails. This leaves the protected tag and draft release behind.
Require each numeric component to match 0|[1-9][0-9]*.
There was a problem hiding this comment.
Good catch—fixed locally in a follow-up commit. The workflow now rejects leading-zero major, minor, and patch components before creating a tag.
Context
The manual release workflow only builds and smoke-tests artifacts. Publishing still requires creating protected tags outside GitHub Actions.
Add guarded Actions UI modes for publishing an RC from
mainand promoting an accepted RC commit to stable, while retaining human-pushed tags as a fallback.Changes
dry-run,publish-rc, andpromote-stableoperations with input and release-state validation.releaseenvironment and a narrowly scoped GitHub App.Repository setup
releaseenvironment and restricted it to protected branches.RELEASE_APP_CLIENT_IDandRELEASE_APP_PRIVATE_KEY.Test
make -C collector test— passedgo run github.com/rhysd/actionlint/cmd/actionlint@v1.7.7 -ignore 'label "macos-15-intel" is unknown' .github/workflows/release.yml— passedbash -n.gh release viewcommand reads the current rolling draft outside a Git checkout.