Skip to content

ci: append a "## Changes" commit list to each release - #32

Merged
snowmead merged 1 commit into
mainfrom
ci/release-notes
Jun 17, 2026
Merged

ci: append a "## Changes" commit list to each release#32
snowmead merged 1 commit into
mainfrom
ci/release-notes

Conversation

@snowmead

Copy link
Copy Markdown
Contributor

Each GitHub Release currently shows only dist's install + download table — nothing about what changed. This adds .github/workflows/release-notes.yml, which appends a ## Changes section listing every commit since the previous version tag.

Format: - <short-sha> <subject> (e.g. - fcb5ec2 feat(mcp): … (#30)). GitHub auto-links the SHA and the trailing (#NN).

Why workflow_run, not on: release: dist's host job creates the release with the default GITHUB_TOKEN, and GitHub suppresses workflow runs triggered by GITHUB_TOKEN-caused events — so an on: release trigger would silently never fire. Triggering on the Release workflow's completion is not suppressed and guarantees the release already exists. It's a standalone file, so regenerating release.yml with dist generate never touches it.

Safety / robustness:

  • Idempotent — skips if the body already has a ## Changes section (re-run safe).
  • First release (no prior tag) lists all commits up to the tag.
  • Only runs for successful tag-push Release runs (event == 'push'), so PR runs of release.yml are skipped.
  • No untrusted input reaches the shell: commit messages come from git log (data), ref: is a hex head_sha, and checkout is SHA-pinned.

Verified the underlying logic locally against the existing tags:

$ git log v0.3.0..v0.4.0 --no-merges --pretty='- %h %s'
- fcb5ec2 feat(mcp): lock-elected single-writer file watcher; release 0.4.0 (#30)

Takes effect on the next release tag (v0.5.0+). v0.4.0 can be backfilled separately if desired.

🤖 Generated with Claude Code

Comment thread .github/workflows/release-notes.yml Fixed
Each GitHub Release currently shows only dist's install + download table.
Add a workflow that, after the Release workflow completes for a tag, appends
a "## Changes" section listing every commit in the release (since the previous
version tag) as `- <sha> <subject>` — GitHub auto-links the sha and PR number.

- Triggers on `workflow_run` (Release completion), not `on: release`: dist
  creates the release with GITHUB_TOKEN and GitHub suppresses workflow runs
  from GITHUB_TOKEN-caused events, so `on: release` would never fire.
- Reads everything through the GitHub API (tags + compare) instead of checking
  out the repo, so the privileged workflow_run job never checks out untrusted
  code (resolves CodeQL actions/untrusted-checkout).
- Idempotent (skips if a Changes section exists), handles the first release,
  and only runs for successful tag-push Release runs.
- Standalone file, so `dist generate` never touches it.
@snowmead
snowmead merged commit 4097fef into main Jun 17, 2026
12 checks passed
@snowmead
snowmead deleted the ci/release-notes branch June 17, 2026 12:42
@snowmead snowmead mentioned this pull request Jul 30, 2026
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants