Skip to content

label-pr.yml

Add or sync labels on pull requests using a configuration file.

Inputs

InputTypeDescriptionRequiredDefault
CONF_PATHstringPath to the labeler configuration fileYes-

Permissions

ScopeAccessDescription
pull-requestswriteRequired to add PR labels

Examples

Simple example

yaml
jobs:
  label:
    uses: this-is-tobi/github-workflows/.github/workflows/label-pr.yml@main
    with:
      CONF_PATH: .github/labeler-conf.yml

Example configuration file (.github/labeler-conf.yml):

yaml
doc:
- changed-files:
  - any-glob-to-any-file:
    - "docs/**"
api:
- changed-files:
  - any-glob-to-any-file: 
    - "apps/api/**"
client:
- changed-files:
  - any-glob-to-any-file: 
    - "apps/client/**"
ci:
- changed-files:
  - any-glob-to-any-file: 
    - ".github/**"
    - "ci/**"

For more details on the configuration file format, see the labeler action documentation.