Skip to content

Commit ff7e445

Browse files
authored
Require merge commit for merge PR (+ new rules.yml file) (#1600)
1 parent 22ba74e commit ff7e445

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

.github/workflows/rules.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
name: rules
3+
4+
on:
5+
workflow_dispatch: {}
6+
pull_request:
7+
types:
8+
- auto_merge_enabled
9+
10+
jobs:
11+
require_merge_commit_on_merge_script_pr:
12+
name: Merge script PRs must create merge commits
13+
if: ${{ contains(github.head_ref, '/merge-') }}
14+
runs-on: ubuntu-latest
15+
steps:
16+
- run: |
17+
if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then
18+
echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'"
19+
exit 1
20+
fi
21+

0 commit comments

Comments
 (0)