Close stale issues even if they were just marked stale (#64)

This commit is contained in:
Ross Brodbeck
2020-05-11 11:15:05 -04:00
committed by GitHub
parent 1e900bc060
commit e611bf905b
3 changed files with 52 additions and 13 deletions

18
dist/index.js vendored
View File

@@ -8510,14 +8510,20 @@ class IssueProcessor {
core.debug(`Skipping ${issueType} because it has an exempt label`);
continue; // don't process exempt issues
}
if (IssueProcessor.isLabeled(issue, staleLabel)) {
core.debug(`Found a stale ${issueType}`);
yield this.processStaleIssue(issue, issueType, staleLabel);
}
else if (!IssueProcessor.updatedSince(issue.updated_at, this.options.daysBeforeStale)) {
core.debug(`Marking ${issueType} stale because it was last updated on ${issue.updated_at}`);
// does this issue have a stale label?
let isStale = IssueProcessor.isLabeled(issue, staleLabel);
// determine if this issue needs to be marked stale first
if (!isStale &&
!IssueProcessor.updatedSince(issue.updated_at, this.options.daysBeforeStale)) {
core.debug(`Marking ${issueType} stale because it was last updated on ${issue.updated_at} and it does not have a stale label`);
yield this.markStale(issue, staleMessage, staleLabel);
this.operationsLeft -= 2;
isStale = true; // this issue is now considered stale
}
// process any issues marked stale (including the issue above, if it was marked)
if (isStale) {
core.debug(`Found a stale ${issueType}`);
yield this.processStaleIssue(issue, issueType, staleLabel);
}
}
// do the next batch