Adds labels to a pull request or issue on GitHub.
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| token | string | The `GITHUB_TOKEN` to use for authorization to GitHub | |
| labels | array | The labels to add to the pull request or issue | |
| number | number | The pull request or issue number to add labels to | |
| repoUrl | string | Accepts the format `github.com?repo=reponame&owner=owner` where `reponame` is the repository name and `owner` is an organization or username |
Output Schema
Usage Examples
Add triage labels to a new issue using template parameters
Use this after repository setup with actions like fetch:template to mark a newly created issue for triage. The issue number, owner, and repository come from template parameters.
steps:
- id: label-new-issue
action: github:issues:label
input:
repoUrl: github.com?repo=${{ parameters.repoName }}&owner=${{ parameters.repoOwner }}
number: ${{ parameters.issueNumber }}
labels:
- bug
- needs triage
token: ${{ secrets.githubToken }}Add review labels to a pull request with static values
Use this when you know the repository and pull request number and want to mark the PR as ready for review.
steps:
- id: label-pr-for-review
action: github:issues:label
input:
repoUrl: github.com?repo=payments-service&owner=acme-org
number: 42
labels:
- ready for review
- ciApply release labels to a PR with labels from a parameter
Use this after opening a release PR with an action like publish:github:pull-request. Labels are provided by a multi-select template parameter.
steps:
- id: label-release-pr
action: github:issues:label
input:
repoUrl: github.com?repo=web-portal&owner=acme-org
number: ${{ parameters.prNumber }}
labels: ${{ parameters.releaseLabels }}
token: ${{ secrets.githubToken }}Label an issue in a user repository with a mix of static and dynamic labels
Use this to tag an issue in a personal repository after creating it with github:issues:create. One label comes from user input and one is a standard label.
steps:
- id: label-doc-issue
action: github:issues:label
input:
repoUrl: github.com?repo=${{ parameters.repo }}&owner=${{ parameters.username }}
number: ${{ parameters.issueNumber }}
labels:
- ${{ parameters.primaryLabel }}
- documentation
token: ${{ secrets.githubToken }}Mark a Dependabot PR for security triage
Use this to tag an automated dependency update PR so it is routed to the right team.
steps:
- id: label-dependabot-pr
action: github:issues:label
input:
repoUrl: github.com?repo=platform-infra&owner=acme-org
number: ${{ parameters.dependabotPr }}
labels:
- dependencies
- security
token: ${{ secrets.githubToken }}