GitHub Repository Dispatch Event
Trigger a GitHub Actions workflow or GitHub App webhook.
By default, all
repository_dispatch
activity types trigger a workflow to run, so if you want to limit this to a specific event type, you need to define that in your GitHub workflow.on:
repository_dispatch:
types: [locize/versionPublished]
The data that is sent through the
client_payload
parameter will be available in the github.event
context in your workflow. For example, for a versionPublished event, you can access the payload in a workflow like this:on:
push:
branches: [main]
repository_dispatch:
types: [locize/versionPublished]
jobs:
test1:
name: Test1 (conditional run)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: 'echo "field: ${{ github.event.client_payload.payload.version }}"'
- run: 'echo "payload: ${{ toJson(github.event.client_payload) }}"'
- run: echo baz
if: github.event.client_payload.payload.version == 'production'
test2:
name: Test2 (conditional step)
if: github.event.client_payload.payload.version == 'production'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- run: 'echo "field: ${{ github.event.client_payload.payload.version }}"'
- run: 'echo "payload: ${{ toJson(github.event.client_payload) }}"'
This way you can for example also do some extra conditional checks, like check if the event is coming from the expected version, etc.


The used GitHub token requires write access to the repository by providing either:
- Personal access tokens with
repo
scope. For more information, see "Creating a personal access token for the command line" in the GitHub Help documentation. - GitHub Apps with both
metadata:read
andcontents:read&write
permissions.
Last modified 3mo ago