forked from k8snetworkplumbingwg/sriov-network-operator
-
Notifications
You must be signed in to change notification settings - Fork 1
38 lines (35 loc) · 1.29 KB
/
fork-sync.yaml
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
name: Fork Sync
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:
fail-fast: false
matrix:
branch:
- master
- ${{ needs.lookup-most-recent-release-branch.outputs.most_recent_release_branch }}
steps:
- uses: actions/checkout@v4
if: ${{ matrix.branch != '' }}
- name: Sync
if: ${{ matrix.branch != '' }}
env:
GH_TOKEN: ${{ secrets.GH_TOKEN_NVIDIA_CI_CD }} # classic personal access token permissions: `repo:*,workflow:*`
run: |
gh repo sync ${{ github.repository }} --source k8snetworkplumbingwg/${{ github.event.repository.name }} --branch ${{ matrix.branch }}