Skip to content

Sync/Rebase on Upstream #305

Sync/Rebase on Upstream

Sync/Rebase on Upstream #305

Workflow file for this run

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