ci(issue): 优化 issue 被关闭时的标签处理

pull/1558/head
贤心 2024-01-12 00:05:55 +08:00
parent 66adedff5a
commit 9d9c2787c3
1 changed files with 3 additions and 2 deletions

View File

@ -22,11 +22,12 @@ jobs:
}; };
const issue = await github.rest.issues.get(config); const issue = await github.rest.issues.get(config);
// 是否带有 `bug` 标签 // 是否带有 `bug`, `wontfix` 标签
const hasBugLabel = issue.data.labels.some(label => label.name === 'bug'); const hasBugLabel = issue.data.labels.some(label => label.name === 'bug');
const hasWontfixLabel = issue.data.labels.some(label => label.name === 'wontfix');
// 对带有 `bug` 标签的 issue 追加 `resolved` 标签,表示 bug 已解决。 // 对带有 `bug` 标签的 issue 追加 `resolved` 标签,表示 bug 已解决。
if (hasBugLabel) { if (hasBugLabel && !hasWontfixLabel) {
github.rest.issues.addLabels({ github.rest.issues.addLabels({
...config, ...config,
labels: ['resolved'] labels: ['resolved']