.github/workflows/pr-labeler.yml

25 lines · 990 bytes

 1# Applies labels based on the pull request category
 2name: 🏷️ PR Labeler
 3on:
 4  pull_request:
 5    types: [opened, edited]
 6jobs:
 7  label-pr:
 8    runs-on: ubuntu-latest
 9    permissions: write-all
10    steps:
11      - name: Apply Labels
12        if: "! contains(github.event.pull_request.body, 'Addition / Amendment / Removal / Spelling or Grammar / Website Update / Misc')"
13        uses: Naturalclar/issue-action@v2.0.2
14        with:
15          title-or-body: both
16          github-token: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
17          parameters: >
18            [
19            {"keywords": ["Addition"], "labels": ["Addition"] },
20            {"keywords": ["Amendment"], "labels": ["Amendment"] },
21            {"keywords": ["Removal"], "labels": ["Removal"] },
22            {"keywords": ["Spelling or Grammar"], "labels": ["Grammar"] },
23            {"keywords": ["Website Update"], "labels": ["Website"] },
24            {"keywords": ["Misc"], "labels": ["Misc"] }
25            ]