From 71eea86dc0b221cdd13c6c8a1057cdab73a5bd9a Mon Sep 17 00:00:00 2001 From: Corentin Jabot Date: Tue, 5 Sep 2023 08:55:34 +0200 Subject: [PATCH] [Github] Improve automatic new issue labelling This patch: * Replace andymckay/labeler which does not appear to be maintained by github official solution * Remove the closed issue workflow which was disabled a few years ago and never fixed. * Add 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. Full disclosure, this was not tested, not sure how testing could be done. --- .github/workflows/closed-issues.yml | 20 -------------- .github/workflows/new-issues-labeler.yml | 34 ++++++++++++++++++++++++ .github/workflows/new-issues.yml | 12 +++++---- 3 files changed, 41 insertions(+), 25 deletions(-) delete mode 100644 .github/workflows/closed-issues.yml create mode 100644 .github/workflows/new-issues-labeler.yml diff --git a/.github/workflows/closed-issues.yml b/.github/workflows/closed-issues.yml deleted file mode 100644 index b8ef53d4a4718..0000000000000 --- a/.github/workflows/closed-issues.yml +++ /dev/null @@ -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' diff --git a/.github/workflows/new-issues-labeler.yml b/.github/workflows/new-issues-labeler.yml new file mode 100644 index 0000000000000..e196d7acc337a --- /dev/null +++ b/.github/workflows/new-issues-labeler.yml @@ -0,0 +1,34 @@ +'new issue': + - '/.*/' + +'clang' + - '/\bclang(?!\-)\b/i' + +'clang-format' + - '/\bclang-format/i' + +'clang-tidy' + - '/\bclang-tidy/i' + +'libc++' + - '/\blibc++(?!\-)/i' + - '/\blibcxx(?!\-)/i' + +'libc++-abi' + - '/\blibc++-abi/i' + - '/\blibcxx-abi/i' + +'libc' + - '/\blibc(?![-+])\b/i' + +'flang' + - '/\bflang(?!\-)\b/i' + +'lld' + - '/\blld(?!\-)\b/i' + +'mlir' + - '/\bmlir(?!\-)\b/i' + +'bolt' + - '/\bbolt(?!\-)\b/i' diff --git a/.github/workflows/new-issues.yml b/.github/workflows/new-issues.yml index cd5fa1d583474..e976525366d46 100644 --- a/.github/workflows/new-issues.yml +++ b/.github/workflows/new-issues.yml @@ -9,12 +9,14 @@ 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