Fix: Register CHANGELOG.md as a commit pattern in the release hook - #8
Merged
Merged
Conversation
axion-release's built-in commit hook only stages files explicitly registered via HookContext.addCommitPattern() - it does not commit all working-tree changes. Our changelog-patching hook wrote CHANGELOG.md to disk but never registered it, so the release commit was empty and the patched changelog was discarded. Verified the fix locally with axion's release.localOnly mode in an isolated worktree: the resulting commit now includes the changelog diff (new version header, moved entries, regenerated compare links). This bug caused the real v0.3.0 release to go out with an unpatched CHANGELOG.md and an empty release commit, which in turn made the git-release action fail (it couldn't find a "0.3.0" section) - no GitHub release or package was published for that tag. The v0.3.0 tag is being deleted and the release re-run after this merges.
There was a problem hiding this comment.
Pull request overview
This PR fixes the axion-release pre-release changelog patching hook so the updated CHANGELOG.md is actually staged and included in the release commit (axion only commits files explicitly registered via HookContext.addCommitPattern(...)).
Changes:
- Update the axion
scmVersion { hooks { pre { ... } } }hook to registerCHANGELOG.mdviacontext.addCommitPattern("CHANGELOG.md"). - Document the release-commit staging fix in
CHANGELOG.md.
Reviewed changes
Copilot reviewed 1 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
build.gradle.kts |
Registers CHANGELOG.md as a commit pattern in the axion pre-release hook so the patched changelog is included in the release commit. |
CHANGELOG.md |
Notes the fix in the Unreleased “Fixed” section for release workflow transparency. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tajobe
added a commit
that referenced
this pull request
Jul 22, 2026
axion-release's built-in commit hook only stages files explicitly registered via HookContext.addCommitPattern() - it does not commit all working-tree changes. Our changelog-patching hook wrote CHANGELOG.md to disk but never registered it, so the release commit was empty and the patched changelog was discarded. Verified the fix locally with axion's release.localOnly mode in an isolated worktree: the resulting commit now includes the changelog diff (new version header, moved entries, regenerated compare links). This bug caused the real v0.3.0 release to go out with an unpatched CHANGELOG.md and an empty release commit, which in turn made the git-release action fail (it couldn't find a "0.3.0" section) - no GitHub release or package was published for that tag. The v0.3.0 tag is being deleted and the release re-run after this merges.
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
HookContext.addCommitPattern()— it does not commit all working-tree changes, only what's registered.CHANGELOG.mdto disk but never registered it as a commit pattern, so the release commit ended up empty and the patched changelog was discarded.v0.3.0release to go out broken: the tag was created against an empty "Release version: 0.3.0" commit withCHANGELOG.mdstill showing[Unreleased], which made the downstreamgit-releaseaction fail (it couldn't find a "0.3.0" section) — no GitHub release or package was published for that tag.context.addCommitPattern("CHANGELOG.md")alongside the existingpatchChangelogToVersion(context.releaseVersion)call in the pre-release hook.Test plan
mainrelease.localOnlymode in an isolated git worktree offmain(with the fix applied and a throwaway commit ahead of the last tag, so axion would compute a real next version): the resulting local release commit now includes the fullCHANGELOG.mddiff — new version header, moved unreleased entries, regenerated compare links — instead of being empty./gradlew clean buildpasses