Skip to content

Commit

Permalink
ci: use matrix to allow multiple fork owners in sync-fork action
Browse files Browse the repository at this point in the history
  • Loading branch information
kelly-sovacool authored Jan 2, 2024
1 parent dcb824d commit f5506eb
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/sync-fork.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@ permissions:

env:
GH_TOKEN: ${{ github.token }}
FORK_OWNER: NCIPangea
UPSTREAM_OWNER: CCBR

jobs:
sync:
runs-on: ubuntu-latest
strategy:
matrix:
FORK_OWNER: [NCIPangea]
steps:
- name: get repo name
# required for actions scheduled via cron, as github.event.repository.name won't work
run: |
echo "REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV
- name: sync fork
# only run this action from the forked repo
if: ${{ github.repository_owner == env.FORK_OWNER }}
if: ${{ github.repository_owner == matrix.FORK_OWNER }}
run: |
# required for actions scheduled via cron, as github.event.repository.name won't work
echo "REPO=$(basename ${{ github.repository }})" >> $GITHUB_ENV
# sync the fork from upstream
gh repo sync ${{ github.repository }} --source $UPSTREAM_OWNER/$REPO --force

0 comments on commit f5506eb

Please sign in to comment.