watch

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

Github Event watch #

Github Action Trigger #

source

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
watchstartedLast commit on default branchDefault branch

Note: More than one activity type triggers this event. Although only the started activity type is supported, specifying the activity type will keep your workflow specific if more activity types are added in the future. For information about each activity type, see “Webhook events and payloads.” By default, all activity types trigger workflows that run on this event. You can limit your workflow runs to specific activity types using the types keyword. For more information, see “Workflow syntax for GitHub Actions.”

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

Runs your workflow when the workflow’s repository is starred. For information about the pull request APIs, see “Mutations” in the GraphQL API documentation or “REST API endpoints for activity.”

For example, you can run a workflow when someone stars a repository, which is the started activity type for a watch event.

on:
  watch:
    types: [started]

Event Payload #

source

Activities: started

Common Fields #

These fields are common to every event types available with this trigger.
fieldtyperequireddescription
github.event.actionstartedrequired
github.event.enterpriseobjectoptional

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."

github.event.installationobjectoptional

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."

github.event.organizationobjectoptional

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.

github.event.repositoryobjectrequired

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

github.event.senderobjectrequired

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

started #

This event occurs when there is activity relating to watching, or subscribing to, a repository. For more information about watching, see "Managing your subscriptions." For information about the APIs to manage watching, see "Watching" in the REST API documentation.

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

fieldtyperequireddescription