Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add only-labels option #22

Merged
merged 2 commits into from
Apr 13, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 'Only issues or pull requests with all of these labels are checked if stale. Defaults to `[]` (disabled)' and can be a comma-separated list of labels
default: ''
operations-per-run:
description: 'The maximum number of operations per run, used to control rate limiting'
default: 30
Expand Down
3 changes: 3 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ type Args = {
exemptIssueLabel: string;
stalePrLabel: string;
exemptPrLabel: string;
onlyLabels: string;
operationsPerRun: number;
};

Expand All @@ -40,6 +41,7 @@ async function processIssues(
owner: github.context.repo.owner,
repo: github.context.repo.repo,
state: 'open',
labels: args.onlyLabels,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be comma-separated list of labels:
https://octokit.github.io/rest.js/#octokit-routes-issues

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention that in the description!

per_page: 100,
page: page
});
Expand Down Expand Up @@ -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})
)
Expand Down