diff --git a/.github/scripts/check-template-and-add-labels.ts b/.github/scripts/check-template-and-add-labels.ts index b931e27b055..cc4012a87cc 100644 --- a/.github/scripts/check-template-and-add-labels.ts +++ b/.github/scripts/check-template-and-add-labels.ts @@ -15,6 +15,7 @@ import { RegressionStage, craftRegressionLabel, externalContributorLabel, + needsTriageLabel, invalidIssueTemplateLabel, invalidPullRequestTemplateLabel, } from './shared/label'; @@ -110,6 +111,9 @@ async function main(): Promise { // Add regression label to the bug report issue addRegressionLabelToIssue(octokit, labelable); + // Add needs triage label to the bug report issue + addNeedsTriageLabelToIssue(octokit, labelable); + } else { const errorMessage = "Issue body does not match any of expected templates ('general-issue.yml' or 'bug-report.yml').\n\nMake sure issue's body includes all section titles.\n\nSections titles are listed here: https://github.com/MetaMask/metamask-mobile/blob/main/.github/scripts/shared/template.ts#L14-L37"; @@ -232,6 +236,14 @@ function extractReleaseVersionFromBugReportIssueBody( return version; } +// This function adds the "needs-triage" label to the issue if it doesn't have it +function addNeedsTriageLabelToIssue( + octokit: InstanceType, + issue: Labelable, +): Promise { + await addLabelToLabelable(octokit, issue, needsTriageLabel); +} + // This function adds the correct regression label to the issue, and removes other ones async function addRegressionLabelToIssue( octokit: InstanceType, diff --git a/.github/scripts/shared/label.ts b/.github/scripts/shared/label.ts index 6aa1fbfacc6..67442e9df3d 100644 --- a/.github/scripts/shared/label.ts +++ b/.github/scripts/shared/label.ts @@ -28,6 +28,12 @@ export const externalContributorLabel: Label = { description: 'Issue or PR created by user outside org', }; +export const needsTriageLabel: Label = { + name: 'needs-triage', + color: '#68AEE6', + description: 'Issue needs to be triaged', +}; + export const invalidIssueTemplateLabel: Label = { name: 'INVALID-ISSUE-TEMPLATE', color: 'EDEDED',