diff --git a/github-actions/move-closed-issues/sort-closed-issues.js b/github-actions/move-closed-issues/sort-closed-issues.js index 7093d13c42..d7682bed9a 100644 --- a/github-actions/move-closed-issues/sort-closed-issues.js +++ b/github-actions/move-closed-issues/sort-closed-issues.js @@ -1,4 +1,5 @@ const obtainLabels = require('../utils/obtain-labels'); +const retrieveLabelDirectory = require('../utils/retrieve-label-directory'); /** * Check the labels of an issue, and return the 'status' the issue should be sorted into when closed @@ -10,18 +11,35 @@ function main({ context }) { const doneStatus = 'Done'; const QAStatus = 'QA'; + // Use labelKeys to retrieve current labelNames from directory + const [ + featureRefactorCss, + featureRefactorHtml, + featureRefactorJsLiquid, + featureRefactorGha, + roleBackEndDevOps, + featureAnalytics, + roleFrontEnd + ] = [ + "featureRefactorCss", + "featureRefactorHtml", + "featureRefactorJsLiquid", + "featureRefactorGha", + "roleBackEndDevOps", + "featureAnalytics", + "roleFrontEnd" + ].map(retrieveLabelDirectory); + const hardLabels = [ - 'Feature: Refactor CSS', - 'Feature: Refactor HTML', - 'Feature: Refactor JS / Liquid', - 'Feature: Refactor GHA', + featureRefactorCss, + featureRefactorHtml, + featureRefactorJsLiquid, + featureRefactorGha, ]; - const softLabels = ['role: back end/devOps', 'Feature: Analytics']; - - const overrideSoftLabels = ['role: front end']; + const softLabels = [roleBackEndDevOps, featureAnalytics]; - const issueLabels = obtainLabels(context); + const overrideSoftLabels = [roleFrontEnd]; // checks if label is a hard label const isHardLabel = (label) => hardLabels.includes(label);