sync-upstream #47878
This file contains 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
# 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 |