Repository navigation
ci: enforce conventional PR titles and block direct push to master - #44
Merged
Merged
Conversation
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.
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.
What
pr-title-lint.yml- lints the PR title against Conventional Commits usingamannn/action-semantic-pull-request@v5(job nameValidate PR Title). Runs onpull_request_targetfor every PR (nopaths:filter) so it works for fork PRs and never hangs as a required check.CONTRIBUTING.md, the PR template, andCLAUDE.mdnow state that the PR title must be a valid conventional subject and thatmasteronly takes changes via PR.Why
Releases are cut from the conventional-commit subject on
master. Because the repo squash-merges withsquash_merge_commit_title = PR_TITLE, the PR title is that subject - but nothing enforced its format, and direct pushes tomasterwere only blocked implicitly.Applied out-of-band via the GitHub API (not in this diff)
allow_merge_commit=false,allow_rebase_merge=false,delete_branch_on_merge=true(squash-only).16783810: added apull_requestrule (required_approving_review_count: 0,allowed_merge_methods: ["squash"]) - direct pushes to master are now denied.Follow-up (after this merges)
Add
Validate PR Titleto the ruleset's required status checks. It is held until the workflow exists onmaster, otherwise the required check would have no run to satisfy and would block this first PR.Release flow
Unaffected:
automated-release.ymlopens achore(release): vX.Y.ZPR (valid conventional title) and auto-merges via squash;tag-release.ymlpushes only a tag.