Require merge commit for merge PR (+ new rules.yml file) (#1600)

This commit is contained in:
jar-stripe 2025-05-02 13:51:33 -07:00 committed by GitHub
parent 22ba74e4a6
commit ff7e4451a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

21
.github/workflows/rules.yml vendored Normal file
View File

@ -0,0 +1,21 @@
name: rules
on:
workflow_dispatch: {}
pull_request:
types:
- auto_merge_enabled
jobs:
require_merge_commit_on_merge_script_pr:
name: Merge script PRs must create merge commits
if: ${{ contains(github.head_ref, '/merge-') }}
runs-on: ubuntu-latest
steps:
- run: |
if ${{ github.event.pull_request.auto_merge.merge_method != 'merge' }}; then
echo "Auto-merge method must be 'merge' instead of '${{github.event.pull_request.auto_merge.merge_method}}'"
exit 1
fi