-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from CCBR/cleanup-fork-sync
ci: fix fork-sync action for NCIPangea
- Loading branch information
Showing
3 changed files
with
28 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Sync Fork | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' # once every day | ||
workflow_dispatch: # on button click | ||
push: | ||
paths: | ||
- .github/workflows/sync-fork.yml | ||
|
||
env: | ||
GH_TOKEN: ${{ github.token }} | ||
FORK_OWNER: NCIPangea | ||
UPSTREAM_OWNER: CCBR | ||
|
||
jobs: | ||
sync: | ||
runs-on: ubuntu-latest | ||
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 }} | ||
run: | | ||
gh repo sync ${{ github.repository }} --source $UPSTREAM_OWNER/$REPO --force |