File tree Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Expand file tree Collapse file tree 2 files changed +31
-9
lines changed Original file line number Diff line number Diff line change 5
5
branches :
6
6
- develop
7
7
- main
8
+ repository_dispatch : # 원본 레포에서 이벤트 발생 시 실행되도록 설정
9
+ types : [sync-fork]
8
10
9
11
jobs :
10
12
sync :
11
13
name : Sync to Forked Repo
12
14
runs-on : ubuntu-latest
13
15
14
16
steps :
15
- - name : Checkout branch
17
+ - name : Checkout forked repo
16
18
uses : actions/checkout@v4
17
19
with :
18
20
token : ${{ secrets.AUTO_ACTIONS }}
@@ -27,16 +29,18 @@ jobs:
27
29
echo "TARGET_BRANCH=main" >> $GITHUB_ENV
28
30
fi
29
31
30
- - name : Add remote repository
32
+ - name : Configure Git
31
33
run : |
32
- git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/HomePage-FE
33
- git config user.name dewbeeny
34
- git config user.email ${{ secrets.EMAIL }}
34
+ git config --global user.name "GitHub Actions"
35
+ git config --global user.email "[email protected] "
35
36
36
- - name : Push changes to forked repo
37
+ - name : Add upstream repository (original repo)
37
38
run : |
38
- git push -f https://$GITHUB_ACTOR:${{ secrets.AUTO_ACTIONS }}@github.com/DguFarmSystem/HomePage-FE.git ${{ env.TARGET_BRANCH }}
39
+ git remote add upstream https://github.com/DguFarmSystem/HomePage-FE.git
40
+ git fetch upstream
39
41
40
- - name : Clean up
42
+ - name : Merge upstream changes into forked repo
41
43
run : |
42
- git remote remove forked-repo
44
+ git checkout ${{ env.TARGET_BRANCH }}
45
+ git merge --no-edit upstream/${{ env.TARGET_BRANCH }}
46
+ git push origin ${{ env.TARGET_BRANCH }}
Original file line number Diff line number Diff line change
1
+ name : Trigger Fork Sync
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - develop
7
+ - main
8
+
9
+ jobs :
10
+ trigger :
11
+ runs-on : ubuntu-latest
12
+ steps :
13
+ - name : Send repository_dispatch event to forked repo
14
+ run : |
15
+ curl -X POST -H "Accept: application/vnd.github.v3+json" \
16
+ -H "Authorization: token ${{ secrets.AUTO_ACTIONS }}" \
17
+ https://api.github.com/repos/dewbeeny/HomePage-FE/dispatches \
18
+ -d '{"event_type": "sync-fork"}'
You can’t perform that action at this time.
0 commit comments