[Github] Improve automatic new issue labelling (#65309)

This patch:
* Replaces `andymckay/labeler` which does not appear to be maintained by
github official solution
* Removes the closed issue workflow which was disabled a few years ago
and never fixed.
* Adds a few rules to add label based on PR title, hopefully that can
make triaging simpler. If that turns out to be useful, we can consider
adding more rules for backends, etc. We could technically also pattern
match the body of the issue but I'm concerned about trying to be _too_
clever.

The new system is only triggered on PR open so manual labels should not
be removed.
This commit is contained in:
cor3ntin 2023-09-05 14:53:56 +02:00 committed by GitHub
parent 5463503ae1
commit 3301edf45d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 25 deletions

View File

@ -1,20 +0,0 @@
name: Labeling closed issues
on:
workflow_dispatch
# issues:
# types: ['closed']
permissions:
contents: read
jobs:
automate-issues-labels:
permissions:
issues: write # for andymckay/labeler to label issues
pull-requests: write # for andymckay/labeler to label PRs
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:
- uses: andymckay/labeler@1.0.4
with:
remove-labels: 'awaiting-review'

View File

@ -0,0 +1,32 @@
'new issue':
- '/.*/'
'clang':
- '/\bclang(?!\-)\b/i'
'clang-format':
- '/\bclang-format/i'
'clang-tidy':
- '/\bclang-tidy/i'
'libc++':
- '/libc[+x]{2}(?!\-)/i'
'libc++-abi':
- '/libc[+x]{2}-abi/i'
'libc':
- '/\blibc(?![-+])\b/i'
'flang':
- '/\bflang(?!\-)\b/i'
'lld':
- '/\blld(?!\-)\b/i'
'mlir':
- '/\bmlir(?!\-)\b/i'
'bolt':
- '/\bbolt(?!\-)\b/i'

View File

@ -9,12 +9,15 @@ permissions:
jobs:
automate-issues-labels:
permissions:
issues: write # for andymckay/labeler to label issues
pull-requests: write # for andymckay/labeler to label PRs
issues: write
runs-on: ubuntu-latest
if: github.repository == 'llvm/llvm-project'
steps:
- uses: andymckay/labeler@1.0.4
- uses: github/issue-labeler@v3.2
with:
add-labels: 'new issue'
ignore-if-labeled: true
repo-token: ${{ secrets.GITHUB_TOKEN }}
configuration-path: .github/workflows/new-issues-labeler.yml
include-title: 1
include-body: 0
sync-labels: 0
enable-versioned-regex: 0