Skip to content

Commit 2f0a7aa

Browse files
committed
Fix label creation after deleting deprecated ones
1 parent db4a861 commit 2f0a7aa

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/reporter/github/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,8 @@ export default class GitHub {
6262
}
6363
}
6464

65-
const existingLabelsNames = existingLabels.map(label => label.name);
65+
const updatedExistingLabels = labelsToRemove.length ? await this.getRepositoryLabels() : existingLabels; // Refresh labels after deletion, only if needed
66+
const existingLabelsNames = updatedExistingLabels.map(label => label.name);
6667
const missingLabels = this.MANAGED_LABELS.filter(label => !existingLabelsNames.includes(label.name));
6768

6869
if (missingLabels.length) {

src/reporter/gitlab/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,8 @@ export default class GitLab {
5656
}
5757
}
5858

59-
const existingLabelsNames = existingLabels.map(label => label.name);
59+
const updatedExistingLabels = labelsToRemove.length ? await this.getRepositoryLabels() : existingLabels; // Refresh labels after deletion, only if needed
60+
const existingLabelsNames = updatedExistingLabels.map(label => label.name);
6061
const missingLabels = this.MANAGED_LABELS.filter(label => !existingLabelsNames.includes(label.name));
6162

6263
if (missingLabels.length) {

0 commit comments

Comments
 (0)