Skip to content

Commit a2977f0

Browse files
committed
Add GitHub workflow to enforce PRs from 'develop' to 'main'
1 parent 3591557 commit a2977f0

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: only-develop-to-main
2+
3+
on:
4+
pull_request:
5+
branches: ["main"]
6+
7+
jobs:
8+
enforce:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Allow only develop -> main PRs
12+
run: |
13+
echo "head_ref: ${{ github.head_ref }}"
14+
echo "base_ref: ${{ github.base_ref }}"
15+
if [ "${{ github.base_ref }}" = "main" ] && [ "${{ github.head_ref }}" != "develop" ]; then
16+
echo "Only PRs from 'develop' to 'main' are allowed."
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)