How to link multiple repos off a single push event

Hello, any ideas if is possible to trigger a build multiple repos off a single push event ?

in Jenkins, that is possible using the following directive in Jenkinsfile on repo A:

build job: ‘myOrg/repoB/master’, wait: false
build job: ‘myOrg/repoC/master’, wait: false
build job: ‘myOrg/repoD/master’, wait: false

when a push event is detected for repo A and Jenkinsfile is executed, it will trigger the build process for repos B,C and D even when no push event was explicitly generated for them.

Is there anything similar in Github Actions ? thanks

Hey @rvillane!

This is possible using the repository_dispatch or workflow_dispatch events. When a push event is detected on repo A, you can trigger those events in repos B, C and D

Perhaps using a workflow similar to this:

name: Build
on: push
jobs:
  dispatch:
    strategy:
      matrix:
        repo: ['my-org/repoB', 'my-org/repoC', 'my-org/repoD']
    runs-on: ubuntu-latest
    steps:
      - name: Trigger Build
        uses: peter-evans/repository-dispatch@v1
        with:
          token: ${{ secrets.PAT }}
          repository: ${{ matrix.repo }}
          event-type: push

You’ll need to generate a repo scoped personal access token as the default GH Actions token cannot trigger a repository_dispatch