mirror of
https://gitea.com/Lydanne/issues-helper.git
synced 2025-08-19 10:15:59 +08:00
fix: RemoveLabels when has no label (#88)
* fix: RemoveLabels when has no label * doc
This commit is contained in:
15
dist/index.js
vendored
15
dist/index.js
vendored
@@ -11293,8 +11293,18 @@ async function doRemoveAssignees(owner, repo, issueNumber, assignees) {
|
||||
}
|
||||
|
||||
async function doRemoveLabels(owner, repo, issueNumber, labels) {
|
||||
const dealLabels = dealStringToArr(labels);
|
||||
for (const label of dealLabels) {
|
||||
const issue = await octokit.issues.get({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: issueNumber,
|
||||
});
|
||||
|
||||
const baseLabels = issue.data.labels.map(({ name }) => name);
|
||||
const removeLabels = baseLabels.filter(name => dealStringToArr(labels).includes(name));
|
||||
|
||||
core.info(`Actions: [filter-labels][${removeLabels.join(',')}] success!`);
|
||||
|
||||
for (const label of removeLabels) {
|
||||
await octokit.issues.removeLabel({
|
||||
owner,
|
||||
repo,
|
||||
@@ -11303,6 +11313,7 @@ async function doRemoveLabels(owner, repo, issueNumber, labels) {
|
||||
});
|
||||
core.info(`Actions: [remove-label][${label}] success!`);
|
||||
}
|
||||
|
||||
core.info(`Actions: [remove-labels][${labels}] success!`);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user