This page was generated based on Github’s Documentation. See our welcome page for context and details.
Github Event label
#
Github Action Trigger #
Webhook event payload | Activity types | GITHUB_SHA | GITHUB_REF |
---|---|---|---|
label | - created - edited - deleted | Last commit on default branch | Default 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 issues
, pull_request
, pull_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 #
Activities: created
, deleted
, edited
Common Fields #
These fields are common to every event types available with this trigger.
field | type | required | description |
---|---|---|---|
github.event.enterprise | object | optional | An enterprise on GitHub. Webhook payloads contain the |
github.event.installation | object | optional | The GitHub App installation. Webhook payloads contain the |
github.event.label | object | required | |
github.event.label.color | string | required | 6-character hex code, without the leading #, identifying the color |
github.event.label.default | boolean | required | |
github.event.label.description | string or null | required | |
github.event.label.id | integer | required | |
github.event.label.name | string | required | The name of the label. |
github.event.label.node_id | string | required | |
github.event.label.url | string | required | URL for the label |
github.event.organization | object | optional | A GitHub organization. Webhook payloads contain the |
github.event.repository | object | required | The repository on GitHub where the event occurred. Webhook payloads contain the |
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.
field | type | required | description |
---|---|---|---|
github.event.action | created | required | |
github.event.sender | object | optional | 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.
field | type | required | description |
---|---|---|---|
github.event.action | deleted | required | |
github.event.sender | object | required | 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.
field | type | required | description |
---|---|---|---|
github.event.action | edited | required | |
github.event.changes | object | optional | The changes to the label if the action was |
github.event.changes.color | object | optional | |
github.event.changes.color.from | string | required | The previous version of the color if the action was |
github.event.changes.description | object | optional | |
github.event.changes.description.from | string | required | The previous version of the description if the action was |
github.event.changes.name | object | optional | |
github.event.changes.name.from | string | required | The previous version of the name if the action was |
github.event.sender | object | required | The GitHub user that triggered the event. This property is included in every webhook payload. |