Commit 692e1fc
Add GitHub Actions workflow to block merge commits in PRs (#622)
#### Motivation:
Currently, there is no enforcement of a linear git history in pull
requests. Contributors can merge the base branch into their feature
branches, creating merge commits that make the history harder to read
and bisect. This change enforces a rebase-only workflow to maintain a
clean, linear commit history.
#### Changes:
Added a new GitHub Actions workflow
(`.github/workflows/block-merge-commits.yml`) that:
- Triggers on pull request events (`opened`, `synchronize`, `reopened`)
- Checks out the full git history of the PR
- Scans all commits between the base branch and PR head for merge
commits (commits with more than one parent)
- Fails the check with a clear error message if any merge commits are
detected, prompting contributors to rebase their branch
- Passes successfully when the PR maintains a linear history
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent bf01cde commit 692e1fc
1 file changed
+31
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
0 commit comments