From c830a9705e6d8d4a56cd88ef7d8935cc53aa22ec Mon Sep 17 00:00:00 2001 From: Peter Evans Date: Mon, 25 May 2020 18:16:18 +0900 Subject: [PATCH] Update README --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/README.md b/README.md index 459e743..eb329a3 100644 --- a/README.md +++ b/README.md @@ -55,6 +55,30 @@ jobs: - run: echo ${{ github.event.client_payload.sha }} ``` +### Dispatch to multiple repositories + +You can dispatch to multiple repositories by using a [matrix strategy](https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idstrategy). In the following example, after the `build` job succeeds, an event is dispatched to three different repositories. + +```yml +jobs: + build: + # Main workflow job that builds, tests, etc. + + dispatch: + needs: build + strategy: + matrix: + repo: ['my-org/repo1', 'my-org/repo2', 'my-org/repo3'] + runs-on: ubuntu-latest + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v1 + with: + token: ${{ secrets.REPO_ACCESS_TOKEN }} + repository: ${{ matrix.repo }} + event-type: my-event +``` + ## Client payload The GitHub API allows a maximum of 10 top-level properties in the `client-payload` JSON.