-
Notifications
You must be signed in to change notification settings - Fork 1
43 lines (34 loc) · 1.16 KB
/
mirror.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
name: Mirror Branch to ISYE
on:
push:
branches:
- production
jobs:
mirror:
runs-on: ubuntu-latest
steps:
- name: Checkout CEC repository
run: |
git clone https://github.com/${{github.repository}}
cd ${{github.repository.name}}
- name: Add the ISYE repository as a mirror
run: |
git remote add mirror https://jkolb6:${{ secrets.ISYE_MIRROR_TOKEN }}@github.gatech.edu/isye-web/tmm_hai_cec
git fetch --force mirror
- name: Update CEC repository
run: |
git switch production
git fetch --force origin
git pull
- name: Remove the .github folder to avoid a recursive workflow
run: rm -rf .github
- name: Commit the change
run: |
git config --global user.email ""
git config --global user.name "GitHub Actions"
git commit -a -m "[GitHub Action] Synced with CEC parent repo"
- name: Delete the production branch from ISYE
run: |
git push mirror --delete production --force || true
- name: Push to the ISYE main branch
run: git push mirror production --force