We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 758df70 + 2614d19 commit 1d5ef06Copy full SHA for 1d5ef06
.github/workflows/branch_security.yml
@@ -0,0 +1,21 @@
1
+name: Enforce PR Source Branch
2
+
3
+on:
4
+ pull_request:
5
+ branches:
6
+ - staging
7
+ - prod
8
9
+jobs:
10
+ check-source-branch:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Check PR source branch
14
+ run: |
15
+ if [[ "$GITHUB_BASE_REF" == "staging" && "$GITHUB_HEAD_REF" != "develop" ]]; then
16
+ echo "Only 'develop' can merge into 'staging'"
17
+ exit 1
18
+ elif [[ "$GITHUB_BASE_REF" == "prod" && "$GITHUB_HEAD_REF" != "staging" ]]; then
19
+ echo "Only 'staging' can merge into 'prod'"
20
21
+ fi
0 commit comments