Skip to content

sync-upstream

sync-upstream #47875

Workflow file for this run

# 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