Skip to content

Commit

Permalink
Merge pull request #48 from CCBR/cleanup-fork-sync
Browse files Browse the repository at this point in the history
ci: fix fork-sync action for NCIPangea
  • Loading branch information
kopardev authored Sep 8, 2023
2 parents 0c22bf2 + df43653 commit 2fbbf64
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 45 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/forksync.yml

This file was deleted.

23 changes: 0 additions & 23 deletions .github/workflows/main.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/sync-fork.yml
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

0 comments on commit 2fbbf64

Please sign in to comment.