Skip to content

Commit 11a5f3d

Browse files
authored
Refactor GHA 'sort-closed-issues.js' (#7729)
* refactor labelNames in sort-closed-issues.js to use labelKeys * fixed retrieveLabel import module
1 parent fcaeea0 commit 11a5f3d

File tree

1 file changed

+26
-6
lines changed

1 file changed

+26
-6
lines changed

github-actions/move-closed-issues/sort-closed-issues.js

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
const obtainLabels = require('../utils/obtain-labels');
2+
const retrieveLabelDirectory = require('../utils/retrieve-label-directory');
23

34
/**
45
* Check the labels of an issue, and return the 'status' the issue should be sorted into when closed
@@ -10,16 +11,35 @@ function main({ context }) {
1011
const doneStatus = 'Done';
1112
const QAStatus = 'QA';
1213

14+
// Use labelKeys to retrieve current labelNames from directory
15+
const [
16+
featureRefactorCss,
17+
featureRefactorHtml,
18+
featureRefactorJsLiquid,
19+
featureRefactorGha,
20+
roleBackEndDevOps,
21+
featureAnalytics,
22+
roleFrontEnd
23+
] = [
24+
"featureRefactorCss",
25+
"featureRefactorHtml",
26+
"featureRefactorJsLiquid",
27+
"featureRefactorGha",
28+
"roleBackEndDevOps",
29+
"featureAnalytics",
30+
"roleFrontEnd"
31+
].map(retrieveLabelDirectory);
32+
1333
const hardLabels = [
14-
'Feature: Refactor CSS',
15-
'Feature: Refactor HTML',
16-
'Feature: Refactor JS / Liquid',
17-
'Feature: Refactor GHA',
34+
featureRefactorCss,
35+
featureRefactorHtml,
36+
featureRefactorJsLiquid,
37+
featureRefactorGha,
1838
];
1939

20-
const softLabels = ['role: back end/devOps', 'Feature: Analytics'];
40+
const softLabels = [roleBackEndDevOps, featureAnalytics];
2141

22-
const overrideSoftLabels = ['role: front end'];
42+
const overrideSoftLabels = [roleFrontEnd];
2343

2444
const issueLabels = obtainLabels(context);
2545

0 commit comments

Comments
 (0)