Sync Fork with Upstream #8800
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: | |
| # Run every 5 minutes | |
| - cron: '*/5 * * * *' | |
| # Allow manual triggering | |
| workflow_dispatch: | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| name: Sync Fork with Upstream | |
| # Only run on forks, not on the original repository | |
| if: github.repository != 'Schroedinger-Hat/schroedinger-hat-website' | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Add upstream remote | |
| run: | | |
| git remote add upstream https://github.com/Schroedinger-Hat/schroedinger-hat-website.git | |
| git fetch upstream | |
| - name: Sync fork with upstream main branch | |
| run: | | |
| git checkout main | |
| git merge upstream/main | |
| git push origin main | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |