From d101b6426636e78401bead93e4a7c48df9cdf8b2 Mon Sep 17 00:00:00 2001 From: Darkatse <39111369+Darkatse@users.noreply.github.com> Date: Sat, 10 Oct 2026 00:27:51 -0400 Subject: [PATCH] chore(github): adopt grouped issue labels Issue labels move to type/platform/area/status groups. Templates apply the renamed type labels, the bug form gains HarmonyOS (reports such as #308 had to pick Android), and questions are pointed at Discussions Q&A. A workflow labels the platforms an issue mentions when it is opened. Scanning title and body covers both form and free-form reports; on existing issues it matched the form's platform in 46 of 55 and caught reporters who picked the wrong dropdown entry. Dependabot gets a fixed `dependencies` label so it no longer recreates the ecosystem label `rust`. --- .github/ISSUE_TEMPLATE/bug_report.yml | 3 +- .github/ISSUE_TEMPLATE/config.yml | 4 +++ .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/dependabot.yml | 1 + .github/workflows/issue-platform-labels.yml | 35 +++++++++++++++++++++ 5 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .github/ISSUE_TEMPLATE/config.yml create mode 100644 .github/workflows/issue-platform-labels.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a90d7784..d2f81c75 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,7 +1,7 @@ name: 问题报告 / Bug report description: 报告可复现的 TauriTavern 故障 / Report a reproducible TauriTavern problem title: "[Bug] " -labels: ["bug"] +labels: ["type: bug"] body: - type: markdown attributes: @@ -28,6 +28,7 @@ body: - Linux - Android - iOS + - HarmonyOS validations: required: true diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000..f6683fef --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,4 @@ +contact_links: + - name: 提问与求助 / Questions and help + url: https://github.com/Darkatse/TauriTavern/discussions/categories/q-a + about: 使用问题请在 Discussions 提问。 / Ask usage questions in Discussions. diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index c5489a61..f90751c6 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -1,7 +1,7 @@ name: 功能建议 / Feature request description: 提议一项有明确使用场景的改进 / Propose an improvement grounded in a concrete use case title: "[Feature] " -labels: ["enhancement"] +labels: ["type: feature"] body: - type: markdown attributes: diff --git a/.github/dependabot.yml b/.github/dependabot.yml index da3a6265..144540b5 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -20,3 +20,4 @@ updates: - dependency-name: "dispatch2" commit-message: prefix: "chore(deps)" + labels: ["dependencies"] diff --git a/.github/workflows/issue-platform-labels.yml b/.github/workflows/issue-platform-labels.yml new file mode 100644 index 00000000..3c9f083b --- /dev/null +++ b/.github/workflows/issue-platform-labels.yml @@ -0,0 +1,35 @@ +name: Issue platform labels + +on: + issues: + # Labels removed during triage must stay removed, so edits are not rescanned. + types: [opened] + +permissions: + issues: write + +jobs: + label: + runs-on: ubuntu-latest + steps: + - name: Label platforms mentioned in the issue + uses: actions/github-script@v9 + with: + script: | + const platforms = { + Windows: /\bwin(dows|10|11)?\b/i, + macOS: /\bmac(os|book)?\b/i, + Linux: /\b(linux|ubuntu|debian|fedora|flatpak)\b/i, + Android: /\bandroid\b|安卓/i, + iOS: /\b(ios|ipados|iphone|ipad)\b/i, + HarmonyOS: /\b(harmonyos|openharmony)\b|鸿蒙/i, + }; + const { number, title, body } = context.payload.issue; + const text = `${title}\n${body ?? ''}`; + const labels = Object.keys(platforms) + .filter(name => platforms[name].test(text)) + .map(name => `platform: ${name}`); + + if (labels.length > 0) { + await github.rest.issues.addLabels({ ...context.repo, issue_number: number, labels }); + }