Skip to content

Commit 3c7ec5c

Browse files
committed
chore: add pr branch validation working for main branch
1 parent 92c04c0 commit 3c7ec5c

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)