@cryptotaxi247 / netdata-1 / commits / 7793b9c3b

Switch to actions/labeler@v4 for labeling PRs. (#14203)

This has a number of advantages: - It allows us to make PR labeling event-driven instead of polling. This, in turn, means that it only runs when a PR is modified, and only evaluates that specific PR, which results in spending far less time running PR labeler jobs. - This is the ‘official’ way to handle PR labels automatically as code, and thus Ilya will no longer need to maintain a custom labeling action for this purpose. - The matching syntax supported by this action is more expressive than what is supported by our existing infrastructure, allowing for things sucha s requring all of a group of files to be modified in a PR for it to have a specific label applied. We have no need right now for this, but it is useful to have it available long-term. - Because the labeling is PR-triggered, it shows up in the PR checks, so we can more easily see if auto-labeling has run for a given PR or not.

Austin S. Hemmelgarn committed Jan 4, 2023 at 07:30 UTC 7793b9c3bfe75b3649518ec78954a80b3e33bd38
1 file changed +12 -9
.github/workflows/labeler.yml
+12 -9
@@ -2,17 +2,20 @@
2 # Handles labelling of PR's.
3 name: Pull Request Labeler
4 on:
5 - schedule:
6 - - cron: '*/10 * * * *'
7 -env:
8 - DISABLE_TELEMETRY: 1
5 + pull_request_target: null
6 +concurrency:
7 + group: pr-label-${{ github.ref }}
8 + cancel-in-progress: true
9 jobs:
10 labeler:
11 + name: Apply PR Labels
12 runs-on: ubuntu-latest
13 + permissions:
14 + contents: read
15 + pull-requests: write
16 steps:
13 - - uses: docker://docker.io/ilyam8/periodic-pr-labeler:v0.1.0
17 + - uses: actions/labeler@v4
18 if: github.repository == 'netdata/netdata'
15 - env:
16 - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 - GITHUB_REPOSITORY: ${{ github.repository }}
18 - LABEL_MAPPINGS_FILE: .github/labeler.yml
19 + with:
20 + repo-token: "${{ secrets.GITHUB_TOKEN }}"
21 + sync-labels: true