mirror of
https://gitea.com/Lydanne/pr-extract-issues.git
synced 2025-08-27 14:09:19 +08:00
Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
2befaf5c85 | ||
![]() |
a6c6e82280 | ||
![]() |
cb11554dba | ||
![]() |
4a030f7ef5 |
2
.github/workflows/extract-issues.yml
vendored
2
.github/workflows/extract-issues.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
with:
|
||||
way: 'title'
|
||||
issues-labels: 'l1, l2'
|
||||
remove-labels: 'bug'
|
||||
remove-labels: 'bug, bug2'
|
||||
filter-label: 'bug'
|
||||
issues-comment: |
|
||||
HI。这个 issue: ${number} 已经被修复了。
|
||||
|
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v1.2.1
|
||||
|
||||
`2022.09.23`
|
||||
|
||||
- fix: remove no exit label.
|
||||
|
||||
## v1.2.0
|
||||
|
||||
`2022.09.17`
|
||||
|
@@ -25,7 +25,7 @@ jobs:
|
||||
extract:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions-cool/pr-extract-issues@v1.1.0
|
||||
- uses: actions-cool/pr-extract-issues@v1
|
||||
with:
|
||||
way: 'commit'
|
||||
issues-labels: 'l1, l2'
|
||||
|
13
dist/index.js
vendored
13
dist/index.js
vendored
@@ -11304,7 +11304,7 @@ async function run() {
|
||||
const filterLabel = core.getInput('filter-label');
|
||||
if (filterLabel) {
|
||||
let arr = [];
|
||||
for await (let no of issues) {
|
||||
for await (const no of issues) {
|
||||
const {
|
||||
data: { labels },
|
||||
} = await octokit.issues.get({
|
||||
@@ -11333,7 +11333,7 @@ async function run() {
|
||||
return false;
|
||||
}
|
||||
|
||||
for await (let issue of issues) {
|
||||
for await (const issue of issues) {
|
||||
if (labels) {
|
||||
await octokit.issues.addLabels({
|
||||
owner,
|
||||
@@ -11344,7 +11344,14 @@ async function run() {
|
||||
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
||||
}
|
||||
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({
|
||||
owner,
|
||||
repo,
|
||||
|
13
src/main.js
13
src/main.js
@@ -58,7 +58,7 @@ async function run() {
|
||||
const filterLabel = core.getInput('filter-label');
|
||||
if (filterLabel) {
|
||||
let arr = [];
|
||||
for await (let no of issues) {
|
||||
for await (const no of issues) {
|
||||
const {
|
||||
data: { labels },
|
||||
} = await octokit.issues.get({
|
||||
@@ -87,7 +87,7 @@ async function run() {
|
||||
return false;
|
||||
}
|
||||
|
||||
for await (let issue of issues) {
|
||||
for await (const issue of issues) {
|
||||
if (labels) {
|
||||
await octokit.issues.addLabels({
|
||||
owner,
|
||||
@@ -98,7 +98,14 @@ async function run() {
|
||||
core.info(`Actions: [add-labels][${issue}][${labels}] success!`);
|
||||
}
|
||||
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({
|
||||
owner,
|
||||
repo,
|
||||
|
Reference in New Issue
Block a user