Skip to content
send

GitHub Action

Multiple Repositories Dispatcher

v1.0.2 Latest version

Multiple Repositories Dispatcher

send

Multiple Repositories Dispatcher

An action to dispatch event to multiple repositories

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Multiple Repositories Dispatcher

uses: guilouro/multiple-repositories-dispatch@v1.0.2

Learn more about this action in guilouro/multiple-repositories-dispatch

Choose a version

Multiple Repositories Dispatch

An action to dispatch event to multiple repositories.

How to use

- name: Dispatch event
  uses: guilouro/multiple-repositories-dispatch@latest
  with:
    repo_token: ${{ secrets.REPO_TOKEN }}
    event_type: event_name
    repositories: |
      user/repo1
      user/repo2
    client_payload: '{"github": ${{ toJson(github) }}}'

Action params

Name Required Description Default
repo_token true The Personal Access Token with repo scope of the project which will receive the event
event_type true Event type name that will be used in on: repository_dispatch
repositories true A list of repositories that will receive the event. org/repo
client_payload false JSON payload with extra data {}

Obs: The client_payload is able to send a json with a maximum of 10 top-level as a specification of Github API. Therefore, set the value as this example below when need more than 10

client_payload: '{"github": ${{ toJson(github) }}}'

How to receive the event

name: Receive Dispatch
on:
  repository_dispatch:
    types: [event_name]
jobs:
  echo:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
        run: echo ${{ github.event.client_payload }}

License

MIT