forked from LineageOS/android_device_google_tangorpro
-
Notifications
You must be signed in to change notification settings - Fork 0
31 lines (29 loc) · 941 Bytes
/
sync-upstream.yml
File metadata and controls
31 lines (29 loc) · 941 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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