45 строки
2.1 KiB
YAML
45 строки
2.1 KiB
YAML
name: "Pull Request Labeler"
|
|
on:
|
|
pull_request_target:
|
|
types: [opened, synchronize, reopened, labeled, unlabeled]
|
|
branches: [main, next, release/**/*]
|
|
|
|
permissions:
|
|
pull-requests: write
|
|
|
|
jobs:
|
|
areas_label:
|
|
runs-on: ubuntu-latest
|
|
name: Label areas
|
|
# Skip labeling main-next merge PRs. The area labels are noisy and distracting for main-next PRs because they can
|
|
# contain many commits, and thus touch nearly the whole repo in a single commit. Skipping these labels makes it
|
|
# easier to focus on the more relevant main-next labels.
|
|
#
|
|
# This is implemented by comparing the PR title because at creation time, the PR has no labels (and the GItHub API
|
|
# does not have a way to set labels at creation either), so skipping based on labels does not work.
|
|
steps:
|
|
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4 # ratchet:actions/labeler@v4.0.2
|
|
if: "github.event.pull_request.title != 'Automation: main-next integrate'"
|
|
with:
|
|
configuration-path: ".github/labeler-areas.yml"
|
|
repo-token: "${{ github.token }}"
|
|
sync-labels: true # add/remove labels as modified paths in the PR change
|
|
# Changes to some paths should automatically add the changeset-required label. This label is often added manually, so
|
|
# this CI job calls the labeler action wuth sync-labels=false, so the label won't be removed automatically.
|
|
changesets_label:
|
|
runs-on: ubuntu-latest
|
|
name: Label changeset-required
|
|
steps:
|
|
- uses: actions/labeler@5c7539237e04b714afd8ad9b4aed733815b9fab4 # ratchet:actions/labeler@v4.0.2
|
|
with:
|
|
configuration-path: ".github/labeler-changesets.yml"
|
|
repo-token: "${{ github.token }}"
|
|
sync-labels: false # The changeset-required label is often added manually, so don't remove it.
|
|
branches_label:
|
|
runs-on: ubuntu-latest
|
|
name: Label base branches and external contributors
|
|
steps:
|
|
- uses: srvaroa/labeler@9c29ad1ef33d169f9ef33c52722faf47a566bcf3 # ratchet:srvaroa/labeler@v1
|
|
env:
|
|
GITHUB_TOKEN: "${{ github.token }}"
|