Skip to content

Commit a173212

Browse files
committed
Add sync upstream workflow
Change-Id: I36a0f51e0e5cf19db0fcad901ff84d8117d71e23
1 parent 2b86607 commit a173212

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Sync/Rebase on Upstream
2+
on:
3+
schedule:
4+
- cron: "0 0 * * *" # run daily
5+
workflow_dispatch: # run manually
6+
7+
permissions:
8+
contents: write
9+
10+
jobs:
11+
sync:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@master
15+
with:
16+
fetch-depth: 0 # Fetch all history for rebase
17+
- name: Get initial hash
18+
id: get-initial-hash
19+
run: echo "init_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
20+
- uses: archiemeng/rebase-upstream-action@master
21+
with:
22+
branch: ${{ github.ref_name }}
23+
depth: 0
24+
- name: Get current hash
25+
id: get-current-hash
26+
run: echo "cur_hash=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
27+
- name: Workflow Dispatch
28+
uses: benc-uk/workflow-dispatch@v1.2.4
29+
if: ${{ steps.get-initial-hash.outputs.init_hash != steps.get-current-hash.outputs.cur_hash && hashFiles('.github/workflows/build.yml') != '' }}
30+
with:
31+
workflow: build.yml

0 commit comments

Comments
 (0)