feat: add filterLabel (#19)

* feat: add filterLabel

* add changelog
This commit is contained in:
xrkffgg
2021-03-17 15:10:57 +08:00
committed by GitHub
parent dd11fb5133
commit 78a8afb859
5 changed files with 66 additions and 6 deletions

View File

@@ -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);