repository_dispatches
Creates, updates, deletes, gets or lists a repository_dispatches resource.
Overview
| Name | repository_dispatches |
| Type | Resource |
| Id | github.repos.repository_dispatches |
Fields
The following fields are returned by SELECT queries:
SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
create_dispatch_event | insert | owner, repo, event_type | You can use this endpoint to trigger a webhook event called repository_dispatch when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch event occurs. For an example repository_dispatch webhook payload, see "RepositoryDispatchEvent."The client_payload parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload can be used as a test to debug your workflow.This input example shows how you can use the client_payload as a test to debug your workflow.OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
owner | string | The account owner of the repository. The name is not case sensitive. |
repo | string | The name of the repository without the .git extension. The name is not case sensitive. |
INSERT examples
- create_dispatch_event
- Manifest
You can use this endpoint to trigger a webhook event called repository_dispatch when you want activity that happens outside of GitHub to trigger a GitHub Actions workflow or GitHub App webhook. You must configure your GitHub Actions workflow or GitHub App to run when the repository_dispatch event occurs. For an example repository_dispatch webhook payload, see "RepositoryDispatchEvent."
The client_payload parameter is available for any extra information that your workflow might need. This parameter is a JSON payload that will be passed on when the webhook event is dispatched. For example, the client_payload can include a message that a user would like to send using a GitHub Actions workflow. Or the client_payload can be used as a test to debug your workflow.
This input example shows how you can use the client_payload as a test to debug your workflow.
OAuth app tokens and personal access tokens (classic) need the repo scope to use this endpoint.
INSERT INTO github.repos.repository_dispatches (
event_type,
client_payload,
owner,
repo
)
SELECT
'{{ event_type }}' /* required */,
'{{ client_payload }}',
'{{ owner }}',
'{{ repo }}'
;
# Description fields are for documentation purposes
- name: repository_dispatches
props:
- name: owner
value: "{{ owner }}"
description: Required parameter for the repository_dispatches resource.
- name: repo
value: "{{ repo }}"
description: Required parameter for the repository_dispatches resource.
- name: event_type
value: "{{ event_type }}"
description: |
A custom webhook event name. Must be 100 characters or fewer.
- name: client_payload
value: "{{ client_payload }}"
description: |
JSON payload with extra information about the webhook event that your action or workflow may use. The maximum number of top-level properties is 10. The total size of the JSON payload must be less than 64KB.