GitHub Repository Dispatch Event
Trigger a GitHub Actions workflow or GitHub App webhook.
This type of integration uses the repository_dispatch endpoint of GitHub.
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.
The following example uses the versionPublished event:
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:
The object passed via github.event.client_payload
is the event specified here.
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 updated