ci: add Conventional Commits enforcement for PR titles#337
Merged
Conversation
Adds a GitHub Action that validates PR titles follow the Conventional Commits format (type(scope): description). Since this repo uses squash-merge, the PR title becomes the commit message on main, which release-please uses for changelog generation. Prevents commits from being silently dropped from the changelog when merged without a conventional prefix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Expand the commit message section to explain that PR titles are the commit messages (squash-merge), that non-conforming titles are blocked by CI and silently dropped from the changelog, and include a concrete bad/good example to guide agents. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Adds a pull_request_template.md that reminds authors the PR title becomes the changelog entry via release-please. Includes the format spec, type→changelog mapping, and a bad/good example. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The pinned SHA for amannn/action-semantic-pull-request was not resolvable. Replace with a zero-dependency bash regex check that validates PR titles against the Conventional Commits pattern. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Adds three layers of defense to ensure PR titles follow the Conventional Commits format required by
release-please:.github/pull_request_template.md) — shows the convention inline when creating a PR, visible to both humans and agents..github/workflows/pr-title-lint.yml) — blocks merge if the title doesn't matchtype(scope): description. Uses amannn/action-semantic-pull-request.Context
Several recently merged PRs had non-conventional titles (e.g.,
Compile: write into directory...instead offeat(compile): write into directory...). These were silently ignored by release-please and won't appear in the changelog. This PR prevents that from happening again.Test plan