diff --git a/action.yml b/action.yml index 54a6e2ec..0afa60cd 100644 --- a/action.yml +++ b/action.yml @@ -13,7 +13,7 @@ inputs: description: 'The number of days old an issue can be before marking it stale' default: 60 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 stale-issue-label: description: 'The label to apply when an issue is stale' diff --git a/src/main.ts b/src/main.ts index b24d6287..2624cfb4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -66,7 +66,7 @@ async function processIssues( if (exemptLabel && isLabeled(issue, exemptLabel)) { continue; } else if (isLabeled(issue, staleLabel)) { - if (wasLastUpdatedBefore(issue, args.daysBeforeClose)) { + if (args.daysBeforeClose >= 0 && wasLastUpdatedBefore(issue, args.daysBeforeClose)) { operationsLeft -= await closeIssue(client, issue); } else { continue;