Skip to content

Commit

Permalink
task: add fork-sync github action workflow
Browse files Browse the repository at this point in the history
with scheduled trigger to sync every hour.

Signed-off-by: Michael Zeevi <[email protected]>
  • Loading branch information
maze88 committed May 29, 2024
1 parent 00ce764 commit 108a179
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/fork-sync.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
name: Sync Fork

on:
schedule:
- cron: '0 0 * * *' # nightly
workflow_dispatch: # enable manual trigger

jobs:
lookup-most-recent-release-branch:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Lookup most recent release branch
id: lookup-most-recent-release-branch
run: |
git fetch --all
echo most_recent_release_branch=$(git branch --remotes --sort refname | grep network-operator- | tail -n 1 | cut -d '/' -f 2-) >> $GITHUB_OUTPUT
outputs:
most_recent_release_branch: ${{ steps.lookup-most-recent-release-branch.outputs.most_recent_release_branch }}

sync-fork:
runs-on: ubuntu-latest
needs: lookup-most-recent-release-branch
strategy:
matrix:
branch:
- master
- ${{ needs.lookup-most-recent-release-branch.outputs.most_recent_release_branch }} # if no release branch, this will fail silently
steps:
- uses: tgymnich/[email protected]
with:
owner: k8snetworkplumbingwg # upstream
head: master # upstream
base: ${{ matrix.branch }} # downstream
pr_title: 'task: Sync ${{ matrix.branch }} from upstream'
pr_message: 'Created by [${{ github.repository }} CI](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) (*${{ github.job }}* job).'
retries: 2
retry_after: 10
ignore_fail: true

0 comments on commit 108a179

Please sign in to comment.