github: add specifier to issue github labels

This change adds a specifier to github lables created with "new issue":

- for labels related to architecture specifier is "Arch: xxx"
- for labels related to issue type specifier is "Type: xxx"
- for labels related to host OS type specifier is "OS: xxx"
- for labels related to issue area type specifier is "Area: xxx"
This commit is contained in:
raiden00pl 2024-09-19 13:05:10 +02:00 committed by Xiang Xiao
parent d26357d3e6
commit ff24fc425e
4 changed files with 60 additions and 56 deletions

View File

@ -13,7 +13,7 @@
name: Bug report name: Bug report
description: Report a bug to improve NuttX stability description: Report a bug to improve NuttX stability
title: "[BUG] <title>" title: "[BUG] <title>"
labels: [👀 needs triage, bug] labels: [👀 needs triage, "Type: bug"]
body: body:
- type: markdown - type: markdown
attributes: attributes:
@ -47,11 +47,11 @@ body:
label: On which OS does this issue occur? label: On which OS does this issue occur?
multiple: true multiple: true
options: options:
- "[BSD]" - "[OS: BSD]"
- "[Linux]" - "[OS: Linux]"
- "[Mac]" - "[OS: Mac]"
- "[Windows]" - "[OS: Windows]"
- "[Other]" - "[OS: Other]"
validations: validations:
required: true required: true
@ -78,25 +78,25 @@ body:
description: What architecture(s) are you seeing the problem on? description: What architecture(s) are you seeing the problem on?
multiple: true multiple: true
options: options:
- "[all]" - "[Arch: all]"
- "[arm]" - "[Arch: arm]"
- "[arm64]" - "[Arch: arm64]"
- "[avr]" - "[Arch: avr]"
- "[ceva]" - "[Arch: ceva]"
- "[hc]" - "[Arch: hc]"
- "[mips]" - "[Arch: mips]"
- "[misoc]" - "[Arch: misoc]"
- "[openrisc]" - "[Arch: openrisc]"
- "[renesas]" - "[Arch: renesas]"
- "[risc-v]" - "[Arch: risc-v]"
- "[simulator]" - "[Arch: simulator]"
- "[sparc]" - "[Arch: sparc]"
- "[tricore]" - "[Arch: tricore]"
- "[x86]" - "[Arch: x86]"
- "[x86_64]" - "[Arch: x86_64]"
- "[xtensa]" - "[Arch: xtensa]"
- "[z16]" - "[Arch: z16]"
- "[z80]" - "[Arch: z80]"
validations: validations:
required: true required: true
@ -107,25 +107,25 @@ body:
description: What area(s) are you seeing the problem on? description: What area(s) are you seeing the problem on?
multiple: true multiple: true
options: options:
- "[Other]" - "[Area: Other]"
- "[Applications]" - "[Area: Applications]"
- "[Api]" - "[Area: Api]"
- "[Board support]" - "[Area: Board support]"
- "[Build System]" - "[Area: Build System]"
- "[Configuring]" - "[Area: Configuring]"
- "[Debugging]" - "[Area: Debugging]"
- "[Drivers]" - "[Area: Drivers]"
- "[File System]" - "[Area: File System]"
- "[Installing]" - "[Area: Installing]"
- "[Kconfig]" - "[Area: Kconfig]"
- "[Kernel]" - "[Area: Kernel]"
- "[Memory Management]" - "[Area: Memory Management]"
- "[Native port]" - "[Area: Native port]"
- "[Networking]" - "[Area: Networking]"
- "[OS Components]" - "[Area: OS Components]"
- "[Posix]" - "[Area: Posix]"
- "[Sensors]" - "[Area: Sensors]"
- "[Specific Peripheral]" - "[Area: Specific Peripheral]"
validations: validations:
required: true required: true
@ -145,4 +145,4 @@ body:
label: "Verification" label: "Verification"
options: options:
- label: "I have verified before submitting the report." - label: "I have verified before submitting the report."
required: true required: true

View File

@ -13,7 +13,7 @@
name: Feature request name: Feature request
description: Request an enhancement for NuttX description: Request an enhancement for NuttX
title: "[FEATURE] <title>" title: "[FEATURE] <title>"
labels: [enhancement] labels: ["Type: enhancement"]
body: body:
- type: markdown - type: markdown
attributes: attributes:
@ -59,4 +59,4 @@ body:
label: "Verification" label: "Verification"
options: options:
- label: "I have verified before submitting the report." - label: "I have verified before submitting the report."
required: true required: true

View File

@ -13,7 +13,7 @@
name: General Help name: General Help
description: Get general support regarding NuttX description: Get general support regarding NuttX
title: "[HELP] <title>" title: "[HELP] <title>"
labels: [question] labels: ["Type: question"]
body: body:
- type: markdown - type: markdown
attributes: attributes:
@ -51,4 +51,4 @@ body:
label: "Verification" label: "Verification"
options: options:
- label: "I have verified before submitting the report." - label: "I have verified before submitting the report."
required: true required: true

View File

@ -28,12 +28,16 @@ jobs:
script: | script: |
const body = context.payload.issue.body; const body = context.payload.issue.body;
const bodySplit = body.split(/\[|\]/).map(e => e.toLowerCase()); const bodySplit = body.split(/\[|\]/).map(e => e.toLowerCase());
const oskeywords = ['other', 'bsd', 'linux', 'mac', 'windows']; const oskeywords = ['os: other', 'os: bsd', 'os: Linux', 'os: mac', 'os: windows'];
const archkeywords1 = ['all', 'arm', 'arm64', 'avr', 'ceva', 'hc', 'mips', 'misoc', 'openrisc', 'renesas']; const archkeywords1 = ['arch: all', 'arch: arm', 'arch: arm64', 'arch: avr', 'arch: ceva'];
const archkeywords2 = ['risc-v', 'simulator', 'sparc', 'tricore', 'x86', 'x86_64', 'xtensa', 'z16', 'z80', 'renesas']; const archkeywords2 = ['arch: hc', 'arch: mips', 'arch: misoc', 'arch: openrisc', 'arch:renesas'];
const areakeywords1 = ['applications', 'api', 'board support', 'build system', 'configuring', 'debugging', 'drivers', 'file system', 'installing', 'kconfig']; const archkeywords3 = ['arch: risc-v', 'arch: simulator', 'arch: sparc', 'arch: tricore'];
const areakeywords2 = ['kernel', 'memory management', 'native port', 'networking', 'os components', 'posix', 'sensors', 'specific peripheral', 'openrisc', 'renesas']; const archkeywords4 = ['arch: x86', 'arch: x86_64', 'arch: xtensa', 'arch: z16', 'arch: z80', 'arch:renesas'];
const keywords = [...oskeywords, ...archkeywords1, ...archkeywords2, ...areakeywords1, ...areakeywords2]; const areakeywords1 = ['area: applications', 'area: api', 'area: board support', 'area: build system'];
const areakeywords2 = ['area: configuring', 'area: debugging', 'area: drivers', 'area: file system', 'area: installing', 'area: kconfig'];
const areakeywords3 = ['area: kernel', 'area: memory management', 'area: native port', 'area: networking'];
const areakeywords4 = ['area: os components', 'area: posix', 'area: sensors', 'area: specific peripheral'];
const keywords = [...oskeywords, ...archkeywords1, ...archkeywords2, ...archkeywords3, ...archkeywords4, ...areakeywords1, ...areakeywords2, ...areakeywords3, ...areakeywords4];
var keywordsfound = new Set(); var keywordsfound = new Set();
for (const keyword of keywords) { for (const keyword of keywords) {
if (bodySplit.includes(keyword)) { if (bodySplit.includes(keyword)) {
@ -47,4 +51,4 @@ jobs:
issue_number: context.issue.number, issue_number: context.issue.number,
labels: Array.from(keywordsfound) labels: Array.from(keywordsfound)
}) })
} }