This page was generated based on Github’s Documentation. See our welcome page for context and details.

Github Event repository_dispatch #

Github Action Trigger #


Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
repository_dispatchCustomLast commit on default branchDefault branch

Note: This event will only trigger a workflow run if the workflow file is on the default branch.

You can use the GitHub API to trigger a webhook event called repository_dispatch when you want to trigger a workflow for activity that happens outside of GitHub. For more information, see “REST API endpoints for repositories.”

When you make a request to create a repository_dispatch event, you must specify an event_type to describe the activity type. By default, all repository_dispatch activity types trigger a workflow to run. You can use the types keyword to limit your workflow to run when a specific event_type value is sent in the repository_dispatch webhook payload.

    types: [test_result]

Note: The event_type value is limited to 100 characters.

Any data that you send through the client_payload parameter will be available in the github.event context in your workflow. For example, if you send this request body when you create a repository dispatch event:

  "event_type": "test_result",
  "client_payload": {
    "passed": false,
    "message": "Error: timeout"

then you can access the payload in a workflow like this:

    types: [test_result]

    if: ${{ !github.event.client_payload.passed }}
    runs-on: ubuntu-latest
      - env:
          MESSAGE: ${{ github.event.client_payload.message }}
        run: echo $MESSAGE


  • The maximum number of top-level properties in client_payload is 10.
  • The payload can contain a maximum of 65,535 characters.

Event Payload #


Activities: sample.collected

Common Fields #

These fields are common to every event types available with this trigger.
github.event.client_payloadobject or nullrequired

An enterprise on GitHub. Webhook payloads contain the enterprise property when the webhook is configured on an enterprise account or an organization that’s part of an enterprise account. For more information, see “About enterprise accounts."


The GitHub App installation. Webhook payloads contain the installation property when the event is configured for and sent to a GitHub App. For more information, see “Using webhooks with GitHub Apps."


A GitHub organization. Webhook payloads contain the organization property when the webhook is configured for an organization, or when the event occurs from activity in a repository owned by an organization.


The repository on GitHub where the event occurred. Webhook payloads contain the repository property when the event occurs from activity in a repository.


The GitHub user that triggered the event. This property is included in every webhook payload.

sample.collected #

This event occurs when a GitHub App sends a POST request to /repos/{owner}/{repo}/dispatches. For more information, see the REST API documentation for creating a repository dispatch event.

To subscribe to this event, a GitHub App must have at least read-level access for the "Contents" repository permission.