generated from adobecom/milo-college
-
Notifications
You must be signed in to change notification settings - Fork 5
81 lines (62 loc) · 2.17 KB
/
sync-branches.yml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Sync 02 branches
on:
push:
branches:
- dev
- stage
- main
jobs:
sync-dev02:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'
steps:
- name: Checkout repository
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: Fetch all branches
run: git fetch --all
- name: Check out dev02 branch
run: git checkout dev02
- name: Merge dev into dev02 with theirs strategy
run: git merge origin/dev --strategy-option theirs --allow-unrelated-histories
- name: Push changes to dev02
run: git push origin dev02
sync-stage02:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/stage'
steps:
- name: Checkout repository
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: Fetch all branches
run: git fetch --all
- name: Check out stage02 branch
run: git checkout stage02
- name: Merge stage into stage02 with theirs strategy
run: git merge origin/stage --strategy-option theirs --allow-unrelated-histories
- name: Push changes to stage02
run: git push origin stage02
sync-main02:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout repository
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: Fetch all branches
run: git fetch --all
- name: Check out main02 branch
run: git checkout main02
- name: Merge main into main02 with theirs strategy
run: git merge origin/main --strategy-option theirs --allow-unrelated-histories
- name: Push changes to main02
run: git push origin main02