Merge pull request #16 from actions/dont-close-option

Add option to not close stale issues/prs
This commit is contained in:
Ross Brodbeck 2020-04-13 07:12:39 -04:00 committed by GitHub
commit c5c8bac9c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -13,7 +13,7 @@ inputs:
description: 'The number of days old an issue can be before marking it stale' description: 'The number of days old an issue can be before marking it stale'
default: 60 default: 60
days-before-close: days-before-close:
description: 'The number of days to wait to close an issue or pull request after it being marked stale' description: 'The number of days to wait to close an issue or pull request after it being marked stale. Set to -1 to never close stale issues.'
default: 7 default: 7
stale-issue-label: stale-issue-label:
description: 'The label to apply when an issue is stale' description: 'The label to apply when an issue is stale'

View File

@ -66,7 +66,7 @@ async function processIssues(
if (exemptLabel && isLabeled(issue, exemptLabel)) { if (exemptLabel && isLabeled(issue, exemptLabel)) {
continue; continue;
} else if (isLabeled(issue, staleLabel)) { } else if (isLabeled(issue, staleLabel)) {
if (wasLastUpdatedBefore(issue, args.daysBeforeClose)) { if (args.daysBeforeClose >= 0 && wasLastUpdatedBefore(issue, args.daysBeforeClose)) {
operationsLeft -= await closeIssue(client, issue); operationsLeft -= await closeIssue(client, issue);
} else { } else {
continue; continue;