-
Notifications
You must be signed in to change notification settings - Fork 0
34 lines (29 loc) · 1.03 KB
/
pr-main.yml
File metadata and controls
34 lines (29 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
name: PR to Main Validation
on:
pull_request:
branches: [main]
jobs:
validate-source-branch:
name: Validate source branch
runs-on: ubuntu-latest
steps:
- name: Check source branch
run: |
echo "PR: ${{ github.head_ref }} -> ${{ github.base_ref }}"
if [ "${{ github.head_ref }}" != "develop" ]; then
echo ""
echo "=============================================="
echo "ERROR: Only 'develop' can be merged into 'main'"
echo "=============================================="
echo ""
echo "Source branch: ${{ github.head_ref }}"
echo "Target branch: ${{ github.base_ref }}"
echo ""
echo "Please create a PR from 'develop' to 'main' instead."
echo ""
exit 1
fi
echo ""
echo "=============================================="
echo "OK: PR from 'develop' to 'main' is valid"
echo "=============================================="