Sync Fork with Upstream #6
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: # allows manual run from the Actions tab | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout the fork | |
| uses: actions/checkout@v4 | |
| with: | |
| persist-credentials: false | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global 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 || true | |
| - name: Push changes to fork | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git push https://x-access-token:${GITHUB_TOKEN}@github.com/spruceUI/MainPyUI.git main |