Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .github/workflows/block-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Prevent `develop` from being merged into `stable`

on:
pull_request_target:
types: [opened, reopened, synchronize]
branches: [stable]

jobs:
block:
runs-on: ubuntu-latest
steps:
- name: Fail if develop -> stable
run: |
if [ "${{ github.head_ref }}" = "develop" ]; then
echo "Merging `develop` into `stable` is not allowed."
exit 1
fi

close:
if: github.head_ref == 'develop'
runs-on: ubuntu-latest
steps:
- name: Close PR
run: gh pr close ${{ github.event.pull_request.number }} --repo ${{ github.repository }} --comment "Merging `develop` into `stable` is not allowed."
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Loading