label

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

Github Event label #

Github Action Trigger #

source

Webhook event payloadActivity typesGITHUB_SHAGITHUB_REF
labelcreated
edited
deleted
Last commit on default branchDefault branch

Note: More than one activity type triggers this event. 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 a label in your workflow’s repository is created or modified. For more information about labels, see “Managing labels.” For information about the label APIs, see “Objects” in the GraphQL API documentation or “REST API endpoints for issues.”

If you want to run your workflow when a label is added to or removed from an issue, pull request, or discussion, use the labeled or unlabeled activity types for the issuespull_requestpull_request_target, or discussion events instead.

For example, you can run a workflow when a label has been created or deleted.

on:
  label:
    types: [created, deleted]

Event Payload #

source

Activities: created, deleted, edited

Common Fields #

These fields are common to every event types available with this trigger.
fieldtyperequireddescription
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.labelobjectrequired
github.event.label.colorstringrequired

6-character hex code, without the leading #, identifying the color

github.event.label.defaultbooleanrequired
github.event.label.descriptionstring or nullrequired
github.event.label.idintegerrequired
github.event.label.namestringrequired

The name of the label.

github.event.label.node_idstringrequired
github.event.label.urlstringrequired

URL for the label

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.

created #

This event occurs when there is activity relating to labels. For more information, see "Managing labels." For information about the APIs to manage labels, see the GraphQL documentation or "Labels" in the REST API documentation.

If you want to receive an event when a label is added to or removed from an issue, pull request, or discussion, use the labeled or unlabeled action type for the issues, pull_request, or discussion events instead.

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

fieldtyperequireddescription
github.event.actioncreatedrequired
github.event.senderobjectoptional

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

deleted #

This event occurs when there is activity relating to labels. For more information, see "Managing labels." For information about the APIs to manage labels, see the GraphQL documentation or "Labels" in the REST API documentation.

If you want to receive an event when a label is added to or removed from an issue, pull request, or discussion, use the labeled or unlabeled action type for the issues, pull_request, or discussion events instead.

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

fieldtyperequireddescription
github.event.actiondeletedrequired
github.event.senderobjectrequired

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

edited #

This event occurs when there is activity relating to labels. For more information, see "Managing labels." For information about the APIs to manage labels, see the GraphQL documentation or "Labels" in the REST API documentation.

If you want to receive an event when a label is added to or removed from an issue, pull request, or discussion, use the labeled or unlabeled action type for the issues, pull_request, or discussion events instead.

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

fieldtyperequireddescription
github.event.actioneditedrequired
github.event.changesobjectoptional

The changes to the label if the action was edited.

github.event.changes.colorobjectoptional
github.event.changes.color.fromstringrequired

The previous version of the color if the action was edited.

github.event.changes.descriptionobjectoptional
github.event.changes.description.fromstringrequired

The previous version of the description if the action was edited.

github.event.changes.nameobjectoptional
github.event.changes.name.fromstringrequired

The previous version of the name if the action was edited.

github.event.senderobjectrequired

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