Refactor sync-fork.yml for improved syntax and clarity #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Sync Fork Automatically | |
| on: | |
| push: | |
| branches: ['main'] | |
| jobs: | |
| sync-fork: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout upstream repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.FORK_TOKEN }} | |
| fetch-depth: 0 | |
| ref: main | |
| - name: Add remote-url | |
| run: | | |
| git remote add forked-repo https://pjyoung0511:${{ secrets.FORKED_REPO_TOKEN }}@github.com/pjyoung0511/JECT-4-client | |
| git config user.name pjyoung0511 | |
| git config user.email pjiyoung4512@gmail.com | |
| - name: Push changes to forked-repo | |
| run: | | |
| git push -f forked-repo main | |
| - name: Clean up | |
| run: | | |
| git remote remove forked-repo |