Skip to content

Commit a6ebc12

Browse files
committed
Add main PR guard
1 parent c3483d4 commit a6ebc12

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Main PR Guard
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types: [opened, synchronize, reopened, edited, ready_for_review]
7+
8+
jobs:
9+
require-beta-source:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Require beta as the source branch
13+
if: ${{ github.head_ref != 'beta' }}
14+
run: |
15+
echo "Pull requests into main must come from beta."
16+
echo "Open feature and fix pull requests against beta, then use the Deploy workflow to promote beta into main."
17+
exit 1
18+
19+
- name: Allow beta release PR
20+
if: ${{ github.head_ref == 'beta' }}
21+
run: echo "Release PR from beta to main is allowed."

0 commit comments

Comments
 (0)