From 72d3948bca6c89eeb4be76d777feb6adcb3e641f Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 2 Jan 2024 11:47:23 -0500 Subject: [PATCH 1/3] ci: create action to sync all public CCBR forks resolves https://github.com/CCBR/kelly_log/issues/16 --- .github/workflows/sync-forks.yml | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 .github/workflows/sync-forks.yml diff --git a/.github/workflows/sync-forks.yml b/.github/workflows/sync-forks.yml new file mode 100644 index 0000000..088f904 --- /dev/null +++ b/.github/workflows/sync-forks.yml @@ -0,0 +1,29 @@ +name: Sync Forks + +on: + schedule: + - cron: "47 11 * * *" # once every day + workflow_dispatch: # on button click + push: + paths: + - .github/workflows/sync-forks.yml + +permissions: + contents: write + +env: + # token must be created by someone with write access for all forks + GH_TOKEN: ${{ secrets.SYNC_FORK_TOKEN }} + UPSTREAM_OWNER: CCBR + +jobs: + sync: + runs-on: ubuntu-latest + strategy: + matrix: + FORK_OWNER: [NCIPangea] + REPO: [XAVIER, RENEE] + steps: + - name: sync forked repos + run: | + gh repo sync ${{ matrix.FORK_OWNER }}/${{ matrix.REPO }} --source $UPSTREAM_OWNER/${{ matrix.REPO }} --force From 592627b7a8e9517e5593257c79a35c5a40802d57 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 2 Jan 2024 11:49:08 -0500 Subject: [PATCH 2/3] chore: update comment for personal access token in sync-fork action --- .github/workflows/sync-forks.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/sync-forks.yml b/.github/workflows/sync-forks.yml index 088f904..225da96 100644 --- a/.github/workflows/sync-forks.yml +++ b/.github/workflows/sync-forks.yml @@ -12,7 +12,8 @@ permissions: contents: write env: - # token must be created by someone with write access for all forks + # Token must be created by someone with write access for all forks. + # Be sure to 'configure SSO' from the token creation page for each fork organization. GH_TOKEN: ${{ secrets.SYNC_FORK_TOKEN }} UPSTREAM_OWNER: CCBR From 983851da4e8947232ef939df209f7122332e4ff0 Mon Sep 17 00:00:00 2001 From: Kelly Sovacool Date: Tue, 2 Jan 2024 12:04:04 -0500 Subject: [PATCH 3/3] ci: remove workflow_dispatch trigger not needed because forks can be manually updated with a button click from the fork's main page already --- .github/workflows/sync-forks.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/sync-forks.yml b/.github/workflows/sync-forks.yml index 225da96..15eb2e7 100644 --- a/.github/workflows/sync-forks.yml +++ b/.github/workflows/sync-forks.yml @@ -3,7 +3,6 @@ name: Sync Forks on: schedule: - cron: "47 11 * * *" # once every day - workflow_dispatch: # on button click push: paths: - .github/workflows/sync-forks.yml