mirror of
https://gitea.com/Lydanne/pr-extract-issues.git
synced 2025-08-19 02:06:02 +08:00
@@ -1,5 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
## v1.1.0
|
||||
|
||||
`2021.03.17`
|
||||
|
||||
- feat: add `filter-label`. [#19](https://github.com/actions-cool/pr-extract-issues/pull/19)
|
||||
|
||||
## v1.0.0
|
||||
|
||||
`2021.03.12`
|
||||
|
@@ -25,7 +25,7 @@ jobs:
|
||||
extract:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions-cool/pr-extract-issues@v1.0.0
|
||||
- uses: actions-cool/pr-extract-issues@v1.1.0
|
||||
with:
|
||||
way: 'commit'
|
||||
issues-labels: 'l1, l2'
|
||||
@@ -40,6 +40,7 @@ jobs:
|
||||
| -- | -- | -- | -- |
|
||||
| token | GitHub token | string | ✖ |
|
||||
| way | The way to query issues. Options: `title` `body` `commit` | string | ✔ |
|
||||
| filter-label | Further filter issues through label | string | ✖ |
|
||||
| issues-labels | Extra labels on issues | string | ✖ |
|
||||
| issues-comment | Extra comment on issues | string | ✖ |
|
||||
| issues-close | Extra close issues | string | ✖ |
|
||||
@@ -54,6 +55,7 @@ jobs:
|
||||
- Like: https://github.com/actions-cool/pr-extract-issues/pull/4
|
||||
- Branch whole line display with # start
|
||||
- `commit`: Like `title`
|
||||
- `filter-label`: Note that github default hooks. That is, `fix` `close` `resolve` directly followed by issue number will be closed after success merge
|
||||
- `issues-labels`: Support multiple, need to be separated by comma
|
||||
- `issues-comment`: `${number}` will be replaced with the current issue number
|
||||
- `issues-close`: Whether close issue
|
||||
|
@@ -10,12 +10,14 @@ branding:
|
||||
|
||||
inputs:
|
||||
token:
|
||||
description: Secret GitHub API token to use for making API requests.
|
||||
description: Secret GitHub API token to use for making API requests
|
||||
default: ${{ github.token }}
|
||||
required: true
|
||||
way:
|
||||
description: The way to query issues.
|
||||
description: The way to query issues
|
||||
required: true
|
||||
filter-label:
|
||||
description: Further filter issues through label
|
||||
issues-labels:
|
||||
description: Extra operations on issues
|
||||
issues-comment:
|
||||
@@ -25,7 +27,7 @@ inputs:
|
||||
|
||||
outputs:
|
||||
issues:
|
||||
description: Get issues numbers.
|
||||
description: Get issues numbers
|
||||
|
||||
runs:
|
||||
using: 'node12'
|
||||
|
35
dist/index.js
vendored
35
dist/index.js
vendored
File diff suppressed because one or more lines are too long
19
src/main.js
19
src/main.js
@@ -55,6 +55,25 @@ async function run() {
|
||||
core.setFailed('Wrong way!');
|
||||
}
|
||||
|
||||
const filterLabel = core.getInput('filter-label');
|
||||
if (filterLabel) {
|
||||
let arr = [];
|
||||
for await (let no of issues) {
|
||||
const {
|
||||
data: { labels },
|
||||
} = await octokit.issues.get({
|
||||
owner,
|
||||
repo,
|
||||
issue_number: no,
|
||||
});
|
||||
let o = labels.find(k => k.name == filterLabel);
|
||||
if (o) {
|
||||
arr.push(no);
|
||||
}
|
||||
}
|
||||
issues = [...arr];
|
||||
}
|
||||
|
||||
core.info(`[Action: Query Issues][${issues}]`);
|
||||
core.setOutput('issues', issues);
|
||||
|
||||
|
Reference in New Issue
Block a user