Skip to content

Latest commit

 

History

History
36 lines (29 loc) · 1.08 KB

pr-labeling.md

File metadata and controls

36 lines (29 loc) · 1.08 KB

Automatic PR labeling

Prow Github actions no longer supports automatic labeling of PRs through Github cron jobs. Instead, use the Github actions/labeler action with the new pull_request_target action.

The labeler is documented here.

Refer to this thread and this comment for further discussion on the new action handler: actions/labeler#12 (comment)

name: "Pull Request Labeler"
on:
- pull_request_target

jobs:
  triage:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/labeler@main
      with:
        repo-token: "${{ secrets.GITHUB_TOKEN }}"

This job will run off of the main branch and not the PR'd code. It will inspect the .github/labels.yaml file for file globs and appropriately label the PR based on changed files.

For example, if .github/labels.yaml contains:

source:
  - 'src/**'

and a PR has changed the file src/some/sourcefile.js, the job will label the pr with source.

Again, refer to the PR labeler documentation here.