From d3f96b7cad5682a43876650dfee50bf0de1221ec Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 5 Aug 2026 16:29:27 +0100 Subject: [PATCH] [ci] Add a workflow to trigger synchronisation in forks Add a workflow that dispatches the synchronisation workflow in a repository-defined list of downstream forks. Signed-off-by: Michael Brown --- .github/workflows/syncforks.yml | 48 +++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 .github/workflows/syncforks.yml diff --git a/.github/workflows/syncforks.yml b/.github/workflows/syncforks.yml new file mode 100644 index 000000000..a6a7872b8 --- /dev/null +++ b/.github/workflows/syncforks.yml @@ -0,0 +1,48 @@ +name: Sync Forks + +on: + push: + branches: + - master + - synctest + workflow_dispatch: + +permissions: + contents: read + +jobs: + + sync: + name: Sync + runs-on: ubuntu-latest + if: vars.SYNC_FORKS + strategy: + fail-fast: false + matrix: + fork: ${{ fromJSON ( vars.SYNC_FORKS ) }} + env: + workflow_url: >- + ${{ github.server_url }}/${{ matrix.fork.owner }}/${{ '' + }}${{ matrix.fork.repository }}/actions/workflows/syncrepo.yml + environment: + name: syncforks + url: ${{ env.workflow_url }} + + steps: + + - name: Get token + id: token + uses: actions/create-github-app-token@v3 + with: + client-id: ${{ vars.WORKFLOW_DISPATCHER_ID }} + private-key: ${{ secrets.WORKFLOW_DISPATCHER_KEY }} + owner: ${{ matrix.fork.owner }} + repositories: ${{ matrix.fork.repository }} + + - name: Dispatch + env: + GH_REPO: ${{ matrix.fork.owner }}/${{ matrix.fork.repository }} + GH_TOKEN: ${{ steps.token.outputs.token }} + run: | + gh workflow run syncrepo.yml + echo "Results at ${{ env.workflow_url }}"