mirror of
https://github.com/ipxe/ipxe.git
synced 2026-08-26 13:17:22 -05:00
[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 <mcb30@ipxe.org>
This commit is contained in:
@@ -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 }}"
|
||||
Reference in New Issue
Block a user