Repository navigation
Conversation
👋 Welcome! Looks like this is your first pull request.Hey, thanks for your contribution! Please give us a bit of time to review it. 😄 Please check out our contributing guidelines. |
posquit0
force-pushed
the
feat/github-pr-lint-title
branch
from
October 11, 2026 17:13
6cc87b0 to
4f5d589
Compare
GitHub Actions Integration
✅ All 1 passed. |
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.
👋 Background
Most repositories squash-merge pull requests with the PR title as the commit title (
squash_merge_commit_title: PR_TITLE). The localcommit-msghook only checks local commit messages, so a non-conventional PR title still lands onmainas-is. That breaks tools that read commit titles to compute versions, such asrelease-please, which we are piloting.The first version of this PR used a hand-written bash regex. It now uses commitlint, the de facto standard commit linter, so that:
commit-msghook) and PR titles in CI, and!).What changed
github.pr.lint-titlecomposite action:mise.setup-tools(install: false, its own cache key), so the repository's other tools are not installed.commitlint_versioninput, else the version ofnpm:@commitlint/cliin the repository's mise config (e.g..mise/conf.d/common.toml), else21.2.3. Install@commitlint/cli,config-conventional,loadandparseat that version with mise'snpm:backend.config_file, default.commitlintrc.yaml) when it exists, otherwise with@commitlint/config-conventional. On failure, report commitlint's findings as an::errorannotation.type,scope,breakingandsubjectas outputs (plus theversionused).breakingistruewhen the parser reports aBREAKING CHANGEnote, which theconventionalcommitspreset adds fortype!:titles.Keeping local and CI rules the same
The version comes from the repository's mise config, the same file local development uses, so local commits and PR titles are checked by the same commitlint version with the same
.commitlintrc.yaml. The common files that pinnpm:@commitlint/*in.mise/conf.d/common.toml, add.commitlintrc.yaml, and switch the localcommit-msghook to commitlint are proposed intedilabs/github.Notes
@commitlint/config-conventionalis stricter thanconventional-pre-commit: besides the same 11 types, it rejects subjects in sentence/start/pascal/upper case (feat: Add X), a trailing full stop, and headers longer than 100 characters.env, never interpolated into scripts, so a title such asfeat: $(id)is treated as text. The resolved commitlint version must be an exact version.pull_request, or onpull_request_targetonly with the base branch checked out, never the head of the pull request.Verification
npm:@commitlint/cli = "21.2.2"in.mise/conf.d/common.toml, all four packages are installed at21.2.2; without a mise config,21.2.3is used;commitlint_version: latestis rejectedfeat: ...,refactor(scope)!: ...) pass with the expected outputs, includingbreaking=truefor!;Feat: ...fails with commitlint's findings in the annotation.commitlintrc.yamlis honored (a customheader-max-length: 72rejects an 86-character title that the default config accepts), and the default config is used when the file is missingfeat: $(id) 100%is not executedshellcheck,yamllint(repository config) andcheck-jsonschema --builtin-schema vendor.github-actionspass.