mirror of
https://gitea.com/Lydanne/pr-extract-issues.git
synced 2025-08-23 20:19:17 +08:00
fix: remove no use label
This commit is contained in:
13
dist/index.js
vendored
13
dist/index.js
vendored
@@ -11304,7 +11304,7 @@ async function run() {
|
|||||||
const filterLabel = core.getInput('filter-label');
|
const filterLabel = core.getInput('filter-label');
|
||||||
if (filterLabel) {
|
if (filterLabel) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
for await (let no of issues) {
|
for await (const no of issues) {
|
||||||
const {
|
const {
|
||||||
data: { labels },
|
data: { labels },
|
||||||
} = await octokit.issues.get({
|
} = await octokit.issues.get({
|
||||||
@@ -11333,7 +11333,7 @@ async function run() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for await (let issue of issues) {
|
for await (const issue of issues) {
|
||||||
if (labels) {
|
if (labels) {
|
||||||
await octokit.issues.addLabels({
|
await octokit.issues.addLabels({
|
||||||
owner,
|
owner,
|
||||||
@@ -11344,7 +11344,14 @@ async function run() {
|
|||||||
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
||||||
}
|
}
|
||||||
if (removeLabels && removeLabels.length) {
|
if (removeLabels && removeLabels.length) {
|
||||||
for (const label of removeLabels) {
|
const issueInfo = await octokit.issues.get({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: issue,
|
||||||
|
});
|
||||||
|
const baseLabels = issueInfo.data.labels.map(({ name }) => name);
|
||||||
|
const removes = baseLabels.filter(name => removeLabels.includes(name));
|
||||||
|
for (const label of removes) {
|
||||||
await octokit.issues.removeLabel({
|
await octokit.issues.removeLabel({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
|
13
src/main.js
13
src/main.js
@@ -58,7 +58,7 @@ async function run() {
|
|||||||
const filterLabel = core.getInput('filter-label');
|
const filterLabel = core.getInput('filter-label');
|
||||||
if (filterLabel) {
|
if (filterLabel) {
|
||||||
let arr = [];
|
let arr = [];
|
||||||
for await (let no of issues) {
|
for await (const no of issues) {
|
||||||
const {
|
const {
|
||||||
data: { labels },
|
data: { labels },
|
||||||
} = await octokit.issues.get({
|
} = await octokit.issues.get({
|
||||||
@@ -87,7 +87,7 @@ async function run() {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for await (let issue of issues) {
|
for await (const issue of issues) {
|
||||||
if (labels) {
|
if (labels) {
|
||||||
await octokit.issues.addLabels({
|
await octokit.issues.addLabels({
|
||||||
owner,
|
owner,
|
||||||
@@ -98,7 +98,14 @@ async function run() {
|
|||||||
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
||||||
}
|
}
|
||||||
if (removeLabels && removeLabels.length) {
|
if (removeLabels && removeLabels.length) {
|
||||||
for (const label of removeLabels) {
|
const issueInfo = await octokit.issues.get({
|
||||||
|
owner,
|
||||||
|
repo,
|
||||||
|
issue_number: issue,
|
||||||
|
});
|
||||||
|
const baseLabels = issueInfo.data.labels.map(({ name }) => name);
|
||||||
|
const removes = baseLabels.filter(name => removeLabels.includes(name));
|
||||||
|
for (const label of removes) {
|
||||||
await octokit.issues.removeLabel({
|
await octokit.issues.removeLabel({
|
||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
|
Reference in New Issue
Block a user