Sync Fork with Upstream #54
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: | |
| - cron: "0 4 * * *" # runs daily at 04:00 UTC | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the fork | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # important! ensures full history is available | |
| - name: Configure Git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Add upstream and fetch | |
| run: | | |
| git remote add upstream https://github.com/chrisj951/MainPyUI.git | |
| git fetch upstream | |
| - name: Merge upstream changes | |
| run: | | |
| git checkout main | |
| git merge upstream/main --no-edit | |
| - name: Push changes to fork | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git push origin main |