actions/labeler@v7

Automatically label new pull requests based on the paths of files being changed

At a glance

Latest major
v7
Repository
actions/labeler
Inputs
5 (0 required)
Outputs
2
Runs using
node24
License
MIT
Last checked

Inputs and outputs come straight from the action's official action.yml. See our editorial standards.

Usage

- uses: actions/labeler@v7

Inputs

NameRequiredDefaultDescription
repo-tokenNo${{ github.token }}The GitHub token used to manage labels
configuration-pathNo.github/labeler.ymlThe path for the label configurations
sync-labelsNofalseWhether or not to remove labels when matching files are reverted
dotNotrueWhether or not to auto-include paths starting with dot (e.g. `.github`)
pr-numberNononeThe pull request number(s)

Outputs

NameDescription
new-labelsA comma-separated list of all new labels
all-labelsA comma-separated list of all labels that the PR contains

Read an output with ${{ steps.<step-id>.outputs.<name> }}; the step needs an id.

Examples

Label pull requests by changed paths

Apply labels from the rules in .github/labeler.yml.

name: Example
on:
  pull_request_target:

permissions:
  contents: read
  pull-requests: write

jobs:
  example:
    runs-on: ubuntu-latest
    steps:
      - name: Labeler
        uses: actions/labeler@v7
        with:
          repo-token: ${{ secrets.GITHUB_TOKEN }}

Each example passed actionlint (syntax, expressions and the inputs it knows for this action). They were not run in a live repository, so replace placeholder values such as names, ARNs and paths with your own.

Something out of date or wrong? Report it on our Contact page. This page is rebuilt from the action's repository roughly once a week.