-
Notifications
You must be signed in to change notification settings - Fork 157
38 lines (33 loc) · 1.3 KB
/
sync-upstream.yml
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
32
33
34
35
36
37
38
# Sync forked canary repo with upstream development branch
name: sync-upstream
on:
schedule:
- cron: '*/20 0-3 * * *'
- cron: '*/20 18-23 * * *'
- cron: '0 4-17 * * *'
workflow_dispatch:
jobs:
check-out-of-sync:
if: github.repository == 'frame-labs/frame-canary'
runs-on: ubuntu-latest
outputs:
latest_version: ${{ steps.setlatest.outputs.version }}
steps:
- uses: actions/checkout@v4
- run: git remote add upstream https://github.com/floating/frame.git
- run: git fetch upstream canary
- name: Set latest version
id: setlatest
run: git rev-parse upstream/canary | xargs -I {} echo "version={}" >> "$GITHUB_OUTPUT"
sync:
needs: check-out-of-sync
if: github.sha != needs.check-out-of-sync.outputs.latest_version
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: echo "Version ${{ github.sha }} is out of date, merging in upstream version ${{ needs.check-out-of-sync.outputs.latest_version }}"
- run: git remote add upstream https://github.com/floating/frame.git
- run: git fetch upstream ${{ needs.check-out-of-sync.outputs.latest_version }}
- run: git checkout canary
- run: git merge ${{ needs.check-out-of-sync.outputs.latest_version }}
- run: git push origin canary