-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (40 loc) · 1.42 KB
/
MAIN_burganGitFlowChecker.yaml
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
name: Main Burgan Git Flow Checker
on:
pull_request:
branches:
- main
jobs:
check_commits_main:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Checkout PR Branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: Source Branch PR Checker
run: |
if [[ "$GITHUB_HEAD_REF" == "test" || "$GITHUB_HEAD_REF" == "dev" || "$GITHUB_HEAD_REF" == "preprod" ]]; then
echo "Lütfen kendi branch'inizden PR oluşturun."
exit 1
fi
- name: Check Dev Branch for Commits
run: |
commit=${{ github.event.pull_request.head.sha }}
git checkout origin/dev
git log --oneline | grep $(echo ${commit:0:5})
echo "Commit'lerinizi önce Dev branchine PR yapmalısınız."
- name: Check Test Branch for Commits
run: |
commit=${{ github.event.pull_request.head.sha }}
git checkout origin/test
git log --oneline | grep $(echo ${commit:0:5})
echo "Commit'lerinizi önce Test branchine PR yapmalısınız."
- name: Check Preprod Branch for Commits
run: |
commit=${{ github.event.pull_request.head.sha }}
git checkout origin/preprod
git log --oneline | grep $(echo ${commit:0:5})
echo "Commit'lerinizi önce Preprod branchine PR yapmalısınız."