Skip to content

ci(commitlint): make the PR-title check report on merge_group for the queue - #479

Merged
githubrobbi merged 3 commits into
mainfrom
ci/commitlint-merge-queue-aware
Jun 26, 2026
Merged

ci(commitlint): make the PR-title check report on merge_group for the queue#479
githubrobbi merged 3 commits into
mainfrom
ci/commitlint-merge-queue-aware

Conversation

@githubrobbi

@githubrobbi githubrobbi commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Why

Enabling the merge queue required dropping PR title — Conventional Commits from the ruleset's required checks: a merge queue requires every required check to also report on the merge_group event, but the title linter only ran on pull_request (it reads pull_request.title), so as a required check it would deadlock every queued PR.

This restores the title gate, queue-compatible, so hard Conventional-Commits enforcement comes back inside the queue (release-plz infers the version + changelog from the title — a non-conforming title silently ships no changelog entry).

How

commitlint.yml now also triggers on merge_group. On that event (which carries no PR title) the job recovers the PR number from the queue ref gh-readonly-queue/<base>/pr-<N>-<sha>, fetches that PR's title, and re-lints it against the same Conventional-Commits pattern — the squash subject that will land. The pull_request path (sticky advisory comment, fast author feedback) is unchanged; the merge_group path is a pass/fail gate. Same check-context name, so it can be re-added to the ruleset's required set.

Single-PR queue groups (max_entries_to_build/merge = 1) guarantee the ref names exactly one PR.

Follow-up (right after this merges)

Re-add PR title — Conventional Commits to the main-protection ruleset's required_status_checks (done out-of-band via the API).

… queue

Enabling the merge queue requires every required status check to also
report on the `merge_group` event. The Conventional-Commits PR-title
check only ran on `pull_request` (it reads `pull_request.title`), so as
a required check it would deadlock every queued PR — which is why it had
to be dropped from the required set when the queue was enabled.

This restores it as a hard gate, queue-compatible: on `merge_group` the
job recovers the PR number from the queue ref
(`gh-readonly-queue/<base>/pr-<N>-<sha>`), fetches that PR's title, and
re-lints it against the same Conventional-Commits pattern — the squash
subject that will actually land on main. The pull_request path (sticky
advisory comment, fast author feedback) is unchanged; the merge_group
path is a pass/fail gate with no comment. The check context name is
unchanged, so it can be re-added to the ruleset's required set.

The queue is configured for single-PR groups (max_entries_to_build /
max_entries_to_merge = 1) so the ref always names exactly one PR.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@githubrobbi
githubrobbi enabled auto-merge June 26, 2026 15:29
@githubrobbi
githubrobbi added this pull request to the merge queue Jun 26, 2026
Merged via the queue into main with commit b9b5a45 Jun 26, 2026
26 checks passed
@githubrobbi
githubrobbi deleted the ci/commitlint-merge-queue-aware branch June 26, 2026 16:11
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