We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 92c04c0 commit 3c7ec5cCopy full SHA for 3c7ec5c
.github/workflows/validate-branch-into-main.yaml
@@ -0,0 +1,20 @@
1
+name: Validate PR Branch into Main
2
+
3
+on:
4
+ pull_request:
5
+ branches:
6
+ - main
7
8
+jobs:
9
+ validate-pr-branch:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - name: Check source branch
13
+ run: |
14
+ SOURCE_BRANCH="${{ github.head_ref }}"
15
+ if [[ "$SOURCE_BRANCH" != "develop" ]]; then
16
+ echo "Error: Only pull requests from develop branch are allowed into main"
17
+ echo "Current source branch ($SOURCE_BRANCH)."
18
+ exit 1
19
+ fi
20
+ echo "Source branch is develop - merge allowed"
0 commit comments