Skip to content

chore(release-skill): resolve branch commit vs. commit-msg hook conflict#285

Merged
brunopgalvao merged 2 commits into
masterfrom
chore/improve-release-skill
Apr 27, 2026
Merged

chore(release-skill): resolve branch commit vs. commit-msg hook conflict#285
brunopgalvao merged 2 commits into
masterfrom
chore/improve-release-skill

Conversation

@brunopgalvao

Copy link
Copy Markdown
Contributor

Summary

During the v0.17.0 release cut, Phase 4 step 2 of the release skill hit the repo's commit-msg hook:

  • SKILL.md instructed git commit -m \"Release vX.Y.Z\" on the release branch.
  • The hook (.cargo-husky/hooks/commit-msg) rejects that subject — it enforces conventional-commit prefixes and only exempts chore(release).

The fix exploits the fact that GitHub derives the squash-merge subject on `master` from the PR title, not the branch commit. So the skill now uses two different subjects:

  • Branch commit: `chore(release): vX.Y.Z` — passes the hook, no `--no-verify` required.
  • PR title: `Release vX.Y.Z` — becomes `Release vX.Y.Z (#N)` after squash-merge, which matches the downstream regex `^Release v[0-9]+\.[0-9]+\.[0-9]+ \(#[0-9]+\)$` used by `publish-release.yml`.

Changes

  • `SKILL.md` Phase 4 step 2: branch commit now uses `chore(release): vX.Y.Z`; added explicit note that `Release vX.Y.Z` belongs on the PR title, not the branch.
  • `COMMIT_CONVENTIONS.md`: split "Release commit" section into branch subject + PR title; added explicit "do not" entries against `--no-verify` and against putting `Release v{VERSION}` on the branch commit.

Test plan

  • v0.17.0 release PR (Release v0.17.0 #284) used the new two-subject pattern; `commit-msg` hook passed without `--no-verify`.
  • Next release cut follows the updated SKILL.md without re-discovering the hook conflict.
  • On squash-merge of Release v0.17.0 #284 to master, the resulting commit subject matches `^Release v[0-9]+\.[0-9]+\.[0-9]+ \(#[0-9]+\)$` and `publish-release.yml` tags + publishes `v0.17.0`.

The skill instructed `git commit -m "Release vX.Y.Z"` on the release
branch, but the repo's `commit-msg` hook (`.cargo-husky/hooks/commit-msg`)
rejects that subject — it enforces conventional-commit prefixes and only
exempts `chore(release)`. This surfaced during the v0.17.0 cut.

GitHub derives the squash-merge subject on `master` from the **PR title**,
not the branch commit, so the fix is to use two different subjects:

- Branch commit: `chore(release): vX.Y.Z` (passes the hook)
- PR title: `Release vX.Y.Z` (becomes the squash-merge subject, which
  downstream tooling matches via `^Release v[0-9]+\.[0-9]+\.[0-9]+ \(#[0-9]+\)$`)

This avoids `--no-verify` and keeps both the local hook and the downstream
tag regex satisfied. Updated SKILL.md Phase 4 step 2 and
COMMIT_CONVENTIONS.md with the two-subject pattern and an explicit
"do not" entry against `--no-verify`.
@brunopgalvao brunopgalvao marked this pull request as ready for review April 24, 2026 11:01
@brunopgalvao brunopgalvao enabled auto-merge (squash) April 24, 2026 11:06
@brunopgalvao brunopgalvao merged commit 306e410 into master Apr 27, 2026
4 checks passed
@brunopgalvao brunopgalvao deleted the chore/improve-release-skill branch April 27, 2026 13:16
@github-actions github-actions Bot mentioned this pull request May 4, 2026
3 tasks
@github-actions github-actions Bot mentioned this pull request May 11, 2026
3 tasks
@github-actions github-actions Bot mentioned this pull request May 18, 2026
3 tasks
@brunopgalvao brunopgalvao mentioned this pull request May 21, 2026
9 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.

1 participant