Skip to content

Commit 55b5025

Browse files
committed
Extracted list of triage labels into a const
- These labels have the same behaviour - remove needs:triage but don't comment - Extracting them out makes them easier to find, change and reason about
1 parent 0e3a431 commit 55b5025

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

actions/label-actions/dist/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10237,6 +10237,8 @@ async function main() {
1023710237
if (payload.action === 'labeled') {
1023810238
const label = payload.label;
1023910239

10240+
const TRIAGE_WITHOUT_COMMENT_LABELS = ['bug', 'community project', 'good first issue', 'help wanted'];
10241+
1024010242
if (label.name === 'Ghost(Pro)') {
1024110243
await helpers.removeNeedsTriageLabel(issue);
1024210244
await helpers.leaveComment(issue, comments.GHOST_PRO);
@@ -10264,7 +10266,7 @@ async function main() {
1026410266
} else if (label.name === 'needs:info') {
1026510267
await helpers.removeNeedsTriageLabel(issue);
1026610268
await helpers.leaveComment(issue, comments.NEEDS_INFO);
10267-
} else if (['bug', 'community project', 'good first issue', 'help wanted'].includes(label.name)) {
10269+
} else if (TRIAGE_WITHOUT_COMMENT_LABELS.includes(label.name.toLowerCase())) {
1026810270
await helpers.removeNeedsTriageLabelIfOlder(issue);
1026910271
} else {
1027010272
core.info(`Encountered an unhandled label: ${label.name}`);

actions/label-actions/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,8 @@ async function main() {
124124
if (payload.action === 'labeled') {
125125
const label = payload.label;
126126

127+
const TRIAGE_WITHOUT_COMMENT_LABELS = ['bug', 'community project', 'good first issue', 'help wanted'];
128+
127129
if (label.name === 'Ghost(Pro)') {
128130
await helpers.removeNeedsTriageLabel(issue);
129131
await helpers.leaveComment(issue, comments.GHOST_PRO);
@@ -151,7 +153,7 @@ async function main() {
151153
} else if (label.name === 'needs:info') {
152154
await helpers.removeNeedsTriageLabel(issue);
153155
await helpers.leaveComment(issue, comments.NEEDS_INFO);
154-
} else if (['bug', 'community project', 'good first issue', 'help wanted'].includes(label.name)) {
156+
} else if (TRIAGE_WITHOUT_COMMENT_LABELS.includes(label.name.toLowerCase())) {
155157
await helpers.removeNeedsTriageLabelIfOlder(issue);
156158
} else {
157159
core.info(`Encountered an unhandled label: ${label.name}`);

0 commit comments

Comments
 (0)