Sync Fork with Upstream #21
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 with Upstream | |
| on: | |
| schedule: | |
| # Check for updates daily at 2 AM UTC | |
| - cron: '0 2 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| sync-fork: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| ref: master | |
| - name: Setup Git User | |
| run: | | |
| git config --global user.name "GitHub Actions Bot" | |
| git config --global user.email "actions@github.com" | |
| - name: Add upstream repository | |
| run: | | |
| git remote add upstream https://github.com/golang/go.git | |
| git fetch upstream | |
| - name: Sync fork with upstream | |
| run: | | |
| # Merge upstream changes | |
| git merge upstream/master --no-edit | |
| # Push changes to fork's master branch | |
| git push origin master |