mirror of
https://github.com/actions/stale.git
synced 2025-12-10 12:07:09 +00:00
Don't process a stale issue in the same run it's marked stale (#696)
This commit is contained in:
@@ -20,6 +20,7 @@ export class Issue implements IIssue {
|
||||
readonly milestone?: IMilestone | null;
|
||||
readonly assignees: Assignee[];
|
||||
isStale: boolean;
|
||||
markedStaleThisRun: boolean;
|
||||
operations = new Operations();
|
||||
private readonly _options: IIssuesProcessorOptions;
|
||||
|
||||
@@ -39,6 +40,7 @@ export class Issue implements IIssue {
|
||||
this.milestone = issue.milestone;
|
||||
this.assignees = issue.assignees || [];
|
||||
this.isStale = isLabeled(this, this.staleLabel);
|
||||
this.markedStaleThisRun = false;
|
||||
}
|
||||
|
||||
get isPullRequest(): boolean {
|
||||
|
||||
@@ -465,6 +465,7 @@ export class IssuesProcessor {
|
||||
);
|
||||
await this._markStale(issue, staleMessage, staleLabel, skipMessage);
|
||||
issue.isStale = true; // This issue is now considered stale
|
||||
issue.markedStaleThisRun = true;
|
||||
issueLogger.info(`This $$type is now stale`);
|
||||
} else {
|
||||
issueLogger.info(
|
||||
@@ -666,8 +667,16 @@ export class IssuesProcessor {
|
||||
);
|
||||
}
|
||||
|
||||
if (issue.markedStaleThisRun) {
|
||||
issueLogger.info(`marked stale this run, so don't check for updates`);
|
||||
}
|
||||
|
||||
// Should we un-stale this issue?
|
||||
if (shouldRemoveStaleWhenUpdated && issueHasComments) {
|
||||
if (
|
||||
shouldRemoveStaleWhenUpdated &&
|
||||
issueHasComments &&
|
||||
!issue.markedStaleThisRun
|
||||
) {
|
||||
issueLogger.info(
|
||||
`Remove the stale label since the $$type has a comment and the workflow should remove the stale label when updated`
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user