Skip to content

Latest commit

 

History

History
49 lines (33 loc) · 3.08 KB

02.2_events.md

File metadata and controls

49 lines (33 loc) · 3.08 KB

Events {docsify-ignore-all}

events trigger workflows

Webhook event types and payloads

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.

Finding events

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

Event payloads

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
  • created
  • updated
  • closed
  • reopened
  • edited
  • deleted

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.