File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -67,12 +67,26 @@ jobs:
67
67
68
68
// Add priority-low label to GitHub issues
69
69
const addLowPriorityLabel = async (issueNumber) => {
70
+ // Check if the issue already has the label
71
+ const { data : labels } = await github.rest.issues.listLabelsOnIssue({
72
+ issue_number : issueNumber,
73
+ owner : context.repo.owner,
74
+ repo : context.repo.repo
75
+ });
76
+
77
+ if (labels.some(l => l.name === 'priority-low')) {
78
+ console.log(`Issue # ${issueNumber} already has the label`);
79
+ return;
80
+ }
81
+
82
+ // Add the label
70
83
await github.rest.issues.addLabels({
71
84
issue_number : issueNumber,
72
85
owner : context.repo.owner,
73
86
repo : context.repo.repo,
74
87
labels : ['priority-low']
75
88
});
89
+ console.log(`Added label to issue # ${issueNumber}`);
76
90
}
77
91
78
92
ghIssueNumbers.forEach(async (issueNumber) => {
You can’t perform that action at this time.
0 commit comments