Skip to content

ci: Enforce conventional commit format for PR titles#3666

Merged
buenaflor merged 10 commits into
mainfrom
buenaflor/ci/pr-title-check
Apr 24, 2026
Merged

ci: Enforce conventional commit format for PR titles#3666
buenaflor merged 10 commits into
mainfrom
buenaflor/ci/pr-title-check

Conversation

@buenaflor

@buenaflor buenaflor commented Apr 24, 2026

Copy link
Copy Markdown
Contributor

Add a CI check that validates PR titles against Sentry's conventional commit format and release categories.

This keeps release automation predictable and prevents malformed titles from being merged.

This is especially important now that we generate changelog entries from PR titles

Inspired from https://github.com/getsentry/relay

Made with Cursor

buenaflor and others added 2 commits April 24, 2026 12:15
Adds a workflow that fails when a PR title does not match the
`<type>(<scope>)?: <Subject>` convention from
https://develop.sentry.dev/engineering-practices/commit-messages/.
Re-validates on title edits. Can be bypassed with an `ignore-title`
label if ever needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
- Add `impr`, `enh`, `deps`, `refactor`, `tests` (plural) to match the
  types categorized by `.github/release.yml`.
- Allow breaking-change `!` suffix (e.g. `feat!: ...`) consistent with
  the Breaking Changes pattern in release.yml.
- Drop `license` — not recognized by release.yml and rare enough to
  lose.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@buenaflor
buenaflor requested a review from denrase as a code owner April 24, 2026 10:25
Copilot AI review requested due to automatic review settings April 24, 2026 10:25
@buenaflor buenaflor changed the title ci: enforce conventional commit format for PR titles ci: Enforce conventional commit format for PR titles Apr 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a GitHub Actions workflow to enforce Sentry-style conventional commit formatting for PR titles to keep release automation/changelog categorization consistent.

Changes:

  • Introduces a new PR Title workflow that runs on PR title/label events (and merge_group).
  • Adds a JS validator that checks PR titles against the types defined in .github/release.yml, with an opt-out label.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.

File Description
.github/workflows/pr-title.yml New CI workflow to validate PR titles via actions/github-script.
.github/actions/pr-title/index.js Implements the PR title validation logic and ignore-label behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/actions/pr-title/index.js Outdated
Comment thread .github/workflows/pr-title.yml Outdated
Comment thread .github/workflows/pr-title.yml Outdated
Comment thread .github/workflows/pr-title.yml Outdated
Comment thread .github/workflows/pr-title.yml
buenaflor and others added 2 commits April 24, 2026 12:29
Document that PR descriptions stay minimal by default and avoid test-plan
checklists unless explicitly requested.

This keeps /create-pr output concise and aligned with repository
expectations.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Updated PR title format to require capitalization.
Comment thread .github/actions/pr-title/index.js Outdated
Comment thread .github/actions/pr-title/index.js Outdated
Comment thread .github/actions/pr-title/index.js Outdated
Run title validation directly in github-script, remove the checked-out
local JS helper, and validate associated PRs for merge_group events.

Also relax subject-case enforcement so updater PR titles like
`chore(deps): update ...` continue to pass and map to Dependencies.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Comment thread .github/workflows/pr-title.yml Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 7d75db5. Configure here.

Comment thread .github/workflows/pr-title.yml
Include the pull_request synchronize event so the PR title workflow reruns
when new commits are pushed to an existing pull request.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Comment thread AGENTS.md Outdated
buenaflor and others added 4 commits April 24, 2026 12:59
Drop the ignore-title label escape hatch from the PR title workflow so
all non-draft, non-merged PRs are consistently validated.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Update the workflow job name to `Check Conventional PR Title` so the
GitHub checks list is more explicit.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Drop merge_group triggering and simplify the script to validate only
pull_request payloads.

This removes an unnecessary code path and avoids misleading merge_group
failure messages.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
Require capitalized PR title subjects for human-authored pull requests
while allowing lowercase starts for automated bot PRs.

Update AGENTS guidance to match the bot exception and keep documented
conventions aligned with CI behavior.

Co-Authored-By: Codex 5.3 <[email protected]>
Made-with: Cursor
@buenaflor
buenaflor merged commit 3d61d25 into main Apr 24, 2026
14 checks passed
@buenaflor
buenaflor deleted the buenaflor/ci/pr-title-check branch April 24, 2026 11:16
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.

3 participants