File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed
Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change 44 push :
55 branches :
66 - main # main 브랜치에 push 발생 시 실행
7+ - develop # develop 브랜치에 push 발생 시 실행
78
89jobs :
910 sync :
1011 name : Sync forked repo
11- runs-on : ubuntu-latest
12+ runs-on : ubuntu-latest # GitHub Actions 가상 환경
1213
1314 steps :
14- - name : Checkout main
15+ - name : Checkout current branch
1516 uses : actions/checkout@v4
1617 with :
1718 token : ${{ secrets.AUTO_ACTIONS }}
1819 fetch-depth : 0
19- ref : main
20+
21+ - name : Determine target branch
22+ id : vars
23+ run : |
24+ BRANCH=$(basename "${{ github.ref }}")
25+ echo "TARGET_BRANCH=$BRANCH" >> $GITHUB_ENV
2026
2127 - name : Add remote-url
2228 run : |
23- git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/FarmingLong -FE
29+ git remote add forked-repo https://dewbeeny:${{ secrets.AUTO_ACTIONS }}@github.com/dewbeeny/FarmingLog -FE
2430 git config user.name dewbeeny
2531 git config user.email ${{ secrets.EMAIL }}
2632
2733 - name : Push changes to forked-repo
2834 run : |
29- git push -f forked-repo main
30-
35+ git push -f forked-repo ${{ env.TARGET_BRANCH }}
3136 - name : Clean up
3237 run : |
3338 git remote remove forked-repo
You can’t perform that action at this time.
0 commit comments