From ef9e38cf3a0856593ef8e61bced1faf732de7d37 Mon Sep 17 00:00:00 2001 From: Wojciech Knapik Date: Mon, 6 May 2024 20:51:16 +0200 Subject: [PATCH 1/2] Automatically label issues based on regular expression matches in title and description --- .github/issue-labeler.yml | 31 +++++++++++++++++++ .github/{labeler.yml => pr-labeler.yml} | 0 .github/workflows/assign-issue-labels.yml | 19 ++++++++++++ ...assign-labels.yml => assign-pr-labels.yml} | 3 +- 4 files changed, 52 insertions(+), 1 deletion(-) create mode 100644 .github/issue-labeler.yml rename .github/{labeler.yml => pr-labeler.yml} (100%) create mode 100644 .github/workflows/assign-issue-labels.yml rename .github/workflows/{assign-labels.yml => assign-pr-labels.yml} (90%) diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml new file mode 100644 index 000000000000..f7a171f11d4d --- /dev/null +++ b/.github/issue-labeler.yml @@ -0,0 +1,31 @@ +# This is a mapping of issue labels to title/description regex patterns used by +# https://github.com/github/issue-labeler to automatically add labels to +# issues when opened/edited. +# +# If multiple patterns are provided in the list for a label, they all have to +# match. +# +# To label when any one of multiple patterns matches, concatenate the patterns +# using a "|" delimeter, to form a single pattern. +# +# "^" appears to match only the beginning of the issue title. +# +# Automatic label removal is currently disabled, but could be enabled. + +crash: + - '^Crash Report|Crash ID: crash/' + +OS/Linux: + - 'OS[|:\s]+Linux|Operating System:\s+Linux' + +OS/Windows: + - 'OS[|:\s]+Windows|Operating System:\s+Windows NT' + +OS/macOS: + - 'OS[|:\s]+Mac OS|Operating System:\s+Mac OS X' + +OS/Android: + - 'OS[|:\s]+Android|Operating System:\s+Android' + +OS/iOS: + - 'OS[|:\s]+iOS|Device/OS:\s+iPhone|Operating System:\s+iOS' diff --git a/.github/labeler.yml b/.github/pr-labeler.yml similarity index 100% rename from .github/labeler.yml rename to .github/pr-labeler.yml diff --git a/.github/workflows/assign-issue-labels.yml b/.github/workflows/assign-issue-labels.yml new file mode 100644 index 000000000000..ad56ade5b508 --- /dev/null +++ b/.github/workflows/assign-issue-labels.yml @@ -0,0 +1,19 @@ +name: Assign issue labels +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@c1b0f9f52a63158c4adc09425e858e87b32e9685 # v3.4 + with: + configuration-path: .github/issue-labeler.yml + enable-versioned-regex: 0 + include-title: 1 + #sync-labels: 1 # This removes also manually added labels diff --git a/.github/workflows/assign-labels.yml b/.github/workflows/assign-pr-labels.yml similarity index 90% rename from .github/workflows/assign-labels.yml rename to .github/workflows/assign-pr-labels.yml index 8d4aab15dbdb..dfaba3db7cad 100644 --- a/.github/workflows/assign-labels.yml +++ b/.github/workflows/assign-pr-labels.yml @@ -1,4 +1,4 @@ -name: Assign labels +name: Assign PR labels on: pull_request: @@ -14,6 +14,7 @@ jobs: steps: - uses: actions/labeler@ac9175f8a1f3625fd0d4fb234536d26811351594 # v4.3.0 with: + configuration-path: .github/pr-labeler.yml repo-token: "${{ secrets.GITHUB_TOKEN }}" # Workaround for https://github.com/actions/labeler/issues/104 # Explained at https://github.com/wesnoth/wesnoth/commit/958c82d0867568057caaf58356502ec8c87d8366 From c6b284338cadac3555a1491975ab66c50d6cbef5 Mon Sep 17 00:00:00 2001 From: Wojciech Knapik Date: Mon, 6 May 2024 20:56:18 +0200 Subject: [PATCH 2/2] wip --- .github/issue-labeler.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/issue-labeler.yml b/.github/issue-labeler.yml index f7a171f11d4d..fc0c24849cac 100644 --- a/.github/issue-labeler.yml +++ b/.github/issue-labeler.yml @@ -1,6 +1,6 @@ -# This is a mapping of issue labels to title/description regex patterns used by -# https://github.com/github/issue-labeler to automatically add labels to -# issues when opened/edited. +# This is a mapping of labels to title/description regex patterns used by +# https://github.com/github/issue-labeler to automatically add labels to issues +# when opened/edited. # # If multiple patterns are provided in the list for a label, they all have to # match.