ci: auto-create GitHub Release on tag push#8
Merged
Conversation
Releases were falling out of sync — v0.13.1 / v0.13.2 / v0.14.0 / v0.14.1 all had tags + npm publish but no GitHub Release entries until I created them by hand today. Future tags should auto-publish a Release with notes pulled from the matching CHANGELOG section. Adds a "Create GitHub Release" step at the end of publish.yml: - Skips if a release for the tag already exists (idempotent re-run safe) - Pulls the human-readable suffix from the CHANGELOG header line (`## [VERSION] - DATE — TITLE`) and uses it as the release title - Extracts the body between this version's header and the next `## [` header — same content the CHANGELOG already maintains - Does NOT mark 0.x as prerelease (we treat 0.x as stable for this SDK) - Promotes permissions to `contents: write` (was read-only) — npm publish doesn't need it; gh release create does The script doesn't fail the workflow when no CHANGELOG section is found — emits a `::warning::` so we notice but the npm publish has already happened by that step. We can backfill notes manually after. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 2c7000b. Configure here.
| HEADER=$(grep -E "^## \[$VERSION\]" "$CHANGELOG" | head -1 || true) | ||
| if [ -n "$HEADER" ]; then | ||
| TITLE_SUFFIX=$(echo "$HEADER" | sed -E "s/^## \[$VERSION\] - [0-9-]+ — //") | ||
| RELEASE_TITLE="$TAG — $TITLE_SUFFIX" |
There was a problem hiding this comment.
Sed fallthrough produces malformed release title
Low Severity
When the CHANGELOG header exists but lacks the — TITLE suffix (e.g. ## [0.9.0] - 2026-04-14), the sed substitution pattern won't match, leaving TITLE_SUFFIX as the entire raw header line. RELEASE_TITLE then becomes something like v0.9.0 — ## [0.9.0] - 2026-04-14 — duplicated, with raw markdown formatting in the GitHub Release title.
Reviewed by Cursor Bugbot for commit 2c7000b. Configure here.
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.


Releases were falling out of sync — v0.13.1 / v0.13.2 / v0.14.0 / v0.14.1 all had tags + npm publish but no GitHub Release entries until I created them by hand today. Future tags should auto-publish a Release with notes pulled from the matching CHANGELOG section.
Adds a "Create GitHub Release" step at the end of publish.yml:
## [VERSION] - DATE — TITLE) and uses it as the release title## [header — same content the CHANGELOG already maintainscontents: write(was read-only) — npm publish doesn't need it; gh release create doesThe script doesn't fail the workflow when no CHANGELOG section is found — emits a
::warning::so we notice but the npm publish has already happened by that step. We can backfill notes manually after.Description
Checklist
npm testpasses (all 945+ tests)npm run buildcompiles cleananytypes introducedNote
Low Risk
Low risk CI-only change; main impact is granting
contents: writeto the workflow and adding a release-creation step that could fail due to changelog parsing or GitHub CLI behavior.Overview
Automates GitHub release creation as part of the tag-based publish workflow: after successful npm publishing, the workflow now creates a GitHub Release for the tag using notes extracted from
packages/governance/CHANGELOG.md, and skips creation if the release already exists.To enable this, the workflow’s
permissionsare elevated fromcontents: readtocontents: writesogh release createcan run usingGITHUB_TOKEN(while npm publishing remains token-authenticated).Reviewed by Cursor Bugbot for commit 2c7000b. Bugbot is set up for automated code reviews on this repo. Configure here.