-
Notifications
You must be signed in to change notification settings - Fork 0
44 lines (36 loc) · 1.17 KB
/
chatgpt.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
name: Recursive Merge
on:
push:
branches:
- release/3
- release/2
jobs:
merge:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Git
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
- name: Merge branch
id: merge
run: |
BRANCH=$(echo "${{ github.ref }}" | sed 's/refs\/heads\///')
echo "Current branch: $BRANCH"
if [[ "$BRANCH" == "release/3" ]]; then
TARGET_BRANCH="release/2"
elif [[ "$BRANCH" == "release/2" ]]; then
TARGET_BRANCH="release/1"
else
echo "Branch $BRANCH is not configured for recursive merging"
exit 1
fi
git fetch origin $TARGET_BRANCH
git checkout $TARGET_BRANCH
git merge --no-ff --no-edit $BRANCH
git push origin $TARGET_BRANCH
- name: Check if merge was successful
if: steps.merge.outcome == 'success'
run: echo "Merge to $TARGET_BRANCH was successful"