Skip to content

ci: fail version-bump PRs until the changelog has the new section - #503

Open
tobyhede wants to merge 1 commit into
mainfrom
claude/project-thread-khlvuq
Open

tobyhede wants to merge 1 commit into
mainfrom
claude/project-thread-khlvuq

Conversation

@tobyhede

@tobyhede tobyhede commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Toby

Summary

A PR that changes the workspace version now fails a new Release metadata check until CHANGELOG.md has a ## [X.Y.Z] heading for the new version.
Until now that rule ran only after tagging, in the release workflow's verify-release job, so a mismatched tag got as far as a failed publish.
PRs that don't touch the version pass without checking anything.

This is groundwork for release-plz: its release PR will bump the version, and a person renames ## [Unreleased] in that PR before merging, because the changelog stays hand-written.

Changes

  • .github/scripts/release-metadata.sh: one script with version, check [vX.Y.Z] and check-pr BASE_REF.
    It reads the version from [workspace.package] (not the first version = line in the file) and only accepts the changelog heading at the start of a line, so 3.0.1 no longer counts as a section for 3.0.10.
  • .github/scripts/release-metadata.test.sh: 15 cases in throwaway git repos, run by mise run test:release-metadata and in CI.
  • .github/workflows/release-metadata.yml: runs on every PR (no branch or path filter, so it always reports), tests the script, then runs check-pr against the base branch.
  • release.yml verify-release and mise run release now call the same script instead of their own copies of the check.
  • DEVELOPMENT.md: documents the PR check.

Verification

  • bash .github/scripts/release-metadata.test.sh: 15/15 pass. The tests were written first and failed before the script existed.
  • shellcheck is clean on both scripts.
  • release-metadata.sh check and check v3.0.1 pass on current main.
  • On this PR, which doesn't change the version, the check passes without checking anything, and all CI is green.
  • Throwaway PR DO NOT MERGE: demo of the Release metadata check (#503) #504, stacked on this one and closed unmerged:
    • With a version bump to 3.0.2 and no changelog section, the check failed and said what to rename.
    • Once the ## [3.0.2] section was added, it passed.

Review notes

  • verify-release now rejects a tag that isn't vX.Y.Z[-pre]. mise run release already enforced that format.
  • release/2.2 keeps its own inline check. This only changes main.

Acknowledgment

By submitting this pull request, I confirm that CipherStash can use, modify, copy, and redistribute this contribution, under the terms of CipherStash's choice.

🤖 Generated with Claude Code

The version/changelog rule was only checked after a tag existed, in the
release workflow's verify-release job, so a mismatched tag reached a
failed publish before anyone noticed. Move the rule into one script and
run it on pull requests too: a PR that changes the workspace version
fails until CHANGELOG.md has a '## [X.Y.Z]' heading for it. PRs that
leave the version alone pass without checking anything.

The release workflow and `mise run release` call the same script, so
the three can't drift. The script reads the version from
[workspace.package] rather than the first `version =` line, and only
accepts the heading at the start of a line.

This prepares for release-plz, whose release PR bumps the version while
the changelog stays hand-written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tobyhede tobyhede self-assigned this Nov 9, 2026
@tobyhede
tobyhede marked this pull request as ready for review November 9, 2026 00:58

@cipherstash-agent cipherstash-agent left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review attestation

Reviewed 9fc1745 · posted from Claude Code (scheduled routine) · claude-sonnet-5-5 · effort medium
Sources: code-review (medium, read of the full diff against head; no subagents) · claude-sonnet-5-5
Skills: code-review, review-cross-check, review-post

No findings.

Checked: workspace-version parsing under [workspace.package], the ## [X.Y.Z] prefix match (3.0.1 vs 3.0.10), check-pr against the fetched base ref, the release.yml and mise run release call sites, and the test script's temp-repo cleanup. The PR had no existing review feedback to cross-check. The script and tests were not executed in this run.


Generated by Claude Code

This branch has not been deployed

No deployments
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.

3 participants