Sync/Rebase on Upstream #290
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/Rebase on Upstream | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" # run daily | |
| workflow_dispatch: # run manually | |
| permissions: | |
| contents: write | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@master | |
| with: | |
| fetch-depth: 0 # Fetch all history for rebase | |
| - name: Get initial hash | |
| id: get-initial-hash | |
| run: echo "init_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - uses: archiemeng/rebase-upstream-action@master | |
| with: | |
| branch: ${{ github.ref_name }} | |
| depth: 0 | |
| - name: Get current hash | |
| id: get-current-hash | |
| run: echo "cur_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT | |
| - name: Workflow Dispatch | |
| uses: benc-uk/workflow-dispatch@v1.2.4 | |
| if: ${{ steps.get-initial-hash.outputs.init_hash != steps.get-current-hash.outputs.cur_hash && hashFiles('.github/workflows/build.yml') != '' }} | |
| with: | |
| workflow: build.yml |