GitHub repository webhooks use event names to identify which event triggered any given webhook. These events can be used to define when a workflow is executed within a repository as well.
The best place to look for events that can be used to trigger workflows is at the events that trigger workflows documentation.
Finding the proper event name can be a bit tricky so we will look at a couple examples below:
Event Type | Event Name |
---|---|
PushEvent | push |
PullRequestEvent | pull_request |
IssuesEvent | issues |
DeploymentStatusEvent | deployment_status |
WatchEvent | watch |
The response payload of an event webhook can be used to apply more advanced filtering for a workflow's trigger. An easy example to look at is the ProjectEvent.
We will explore this further through later hands-on exercises.
Webhook Name | Activity Types |
---|---|
project |
|
By specifying an event along with an activity type we can build more precise triggers that execute the workflows in a repository:
on:
project:
type: [created, reopened]
📖Learn more about events that trigger workflows and how to use them.