Add only-labels

This commit is contained in:
Yuya Takeyama 2019-09-27 22:33:20 +09:00
parent 08796943dd
commit 8588c16319
2 changed files with 6 additions and 0 deletions

View File

@ -25,6 +25,9 @@ inputs:
default: 'Stale'
exempt-pr-label:
description: 'The label to apply when a pull request is exempt from being marked stale'
only-labels:
description: 'The labels to apply when only specific issues/pull requests to mark as stale'
default: ''
operations-per-run:
description: 'The maximum number of operations per run, used to control rate limiting'
default: 30

View File

@ -15,6 +15,7 @@ type Args = {
exemptIssueLabel: string;
stalePrLabel: string;
exemptPrLabel: string;
onlyLabels: string;
operationsPerRun: number;
};
@ -40,6 +41,7 @@ async function processIssues(
owner: github.context.repo.owner,
repo: github.context.repo.repo,
state: 'open',
labels: args.onlyLabels,
per_page: 100,
page: page
});
@ -159,6 +161,7 @@ function getAndValidateArgs(): Args {
exemptIssueLabel: core.getInput('exempt-issue-label'),
stalePrLabel: core.getInput('stale-pr-label', {required: true}),
exemptPrLabel: core.getInput('exempt-pr-label'),
onlyLabels: core.getInput('only-labels'),
operationsPerRun: parseInt(
core.getInput('operations-per-run', {required: true})
)