Skip to content

ci: enforce conventional PR titles and block direct push to master - #44

Merged
antonbabenko merged 1 commit into
masterfrom
ci/enforce-conventional-pr-titles
Jun 3, 2026
Merged

antonbabenko merged 1 commit into
masterfrom
ci/enforce-conventional-pr-titles

Conversation

@antonbabenko

Copy link
Copy Markdown
Owner

What

  • New workflow pr-title-lint.yml - lints the PR title against Conventional Commits using amannn/action-semantic-pull-request@v5 (job name Validate PR Title). Runs on pull_request_target for every PR (no paths: filter) so it works for fork PRs and never hangs as a required check.
  • Docs - CONTRIBUTING.md, the PR template, and CLAUDE.md now state that the PR title must be a valid conventional subject and that master only takes changes via PR.

Why

Releases are cut from the conventional-commit subject on master. Because the repo squash-merges with squash_merge_commit_title = PR_TITLE, the PR title is that subject - but nothing enforced its format, and direct pushes to master were only blocked implicitly.

Applied out-of-band via the GitHub API (not in this diff)

  • Repo settings: allow_merge_commit=false, allow_rebase_merge=false, delete_branch_on_merge=true (squash-only).
  • Master ruleset 16783810: added a pull_request rule (required_approving_review_count: 0, allowed_merge_methods: ["squash"]) - direct pushes to master are now denied.

Follow-up (after this merges)

Add Validate PR Title to the ruleset's required status checks. It is held until the workflow exists on master, otherwise the required check would have no run to satisfy and would block this first PR.

Release flow

Unaffected: automated-release.yml opens a chore(release): vX.Y.Z PR (valid conventional title) and auto-merges via squash; tag-release.yml pushes only a tag.

Releases are cut from conventional-commit subjects on master, but nothing
enforced the format and direct pushes were only blocked implicitly.

- Add pr-title-lint.yml: amannn/action-semantic-pull-request on
  pull_request_target, job "Validate PR Title". Lints the PR title (the
  squash subject, since squash_merge_commit_title=PR_TITLE) against the
  angular preset that the release workflow reads. No paths filter so the
  required check runs on every PR.
- Document in CONTRIBUTING.md, the PR template, and CLAUDE.md that the PR
  title must be conventional and that master takes changes via PR only.

The master ruleset and squash-only repo settings are applied out-of-band
via the GitHub API (a pull_request rule denies direct pushes; merge/rebase
methods disabled). "Validate PR Title" becomes a required check once this
workflow is on master.
@antonbabenko
antonbabenko merged commit 1de8726 into master Jun 3, 2026
1 check passed
@antonbabenko
antonbabenko deleted the ci/enforce-conventional-pr-titles branch June 3, 2026 15:49
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