mirror of
https://github.com/actions/stale.git
synced 2025-12-11 12:37:27 +00:00
Close stale issues even if they were just marked stale (#64)
This commit is contained in:
@@ -150,20 +150,29 @@ export class IssueProcessor {
|
||||
continue; // don't process exempt issues
|
||||
}
|
||||
|
||||
if (IssueProcessor.isLabeled(issue, staleLabel)) {
|
||||
core.debug(`Found a stale ${issueType}`);
|
||||
await this.processStaleIssue(issue, issueType, staleLabel);
|
||||
} else if (
|
||||
// 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}`
|
||||
`Marking ${issueType} stale because it was last updated on ${issue.updated_at} and it does not have a stale label`
|
||||
);
|
||||
await 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}`);
|
||||
await this.processStaleIssue(issue, issueType, staleLabel);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user