diff --git a/.github/scripts/check-template-and-add-labels.ts b/.github/scripts/check-template-and-add-labels.ts index dd54fe7e849e..eb2e5578e057 100644 --- a/.github/scripts/check-template-and-add-labels.ts +++ b/.github/scripts/check-template-and-add-labels.ts @@ -16,6 +16,7 @@ import { RegressionStage, craftRegressionLabel, externalContributorLabel, + needsTriageLabel, flakyTestsLabel, invalidIssueTemplateLabel, invalidPullRequestTemplateLabel, @@ -139,6 +140,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-extension/blob/main/.github/scripts/shared/template.ts#L14-L37"; @@ -260,6 +264,13 @@ 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 42447e27937f..e13ab2824fac 100644 --- a/.github/scripts/shared/label.ts +++ b/.github/scripts/shared/label.ts @@ -27,6 +27,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 flakyTestsLabel: Label = { name: 'flaky tests', color: 'BE564E',