actions/labeler
Automatically label pull requests based on the files they change.
What it does
actions/labeler reads path rules from .github/labeler.yml and adds matching labels to a pull request, so triage is automatic.
v5 changed the configuration format; check the README when upgrading from v4.
Usage
workflow (.yml)
on: [pull_request_target]
permissions:
contents: read
pull-requests: write
jobs:
label:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v5Inputs
| Input | Description | Default | Required |
|---|---|---|---|
repo-token | Token used to set labels. | GITHUB_TOKEN | No |
configuration-path | Path to the labeler config. | .github/labeler.yml | No |
sync-labels | Remove labels that no longer match. | false | No |
Notes
Needs pull-requests: write. The config format changed in v5.
Common errors
- No labels applied after upgrading to v5 usually means the
labeler.ymlis still in the v4 format. Resource not accessible by integrationmeans the job lackspull-requests: write.
Security and pinning
- On
pull_request_target, be careful running untrusted code; labeler itself only needs the config and token.
Alternatives and related
Frequently asked questions
Where do I configure which labels apply?
In
.github/labeler.yml, mapping label names to path globs. The v5 format differs from v4.