From 630b3fcfab72405d7128e0b0e5dde2f73a1d93b0 Mon Sep 17 00:00:00 2001 From: 0x5c Date: Fri, 15 Apr 2022 16:15:53 -0400 Subject: [PATCH] Remove stale when updated without comment The existing logic for `remove-stale-when-updated` only considers presence of comments, ignoring the value of `issueHasUpdate`. This commits fixes it so it follows the documented behaviour for that setting. Fixes #715 --- dist/index.js | 4 ++-- src/classes/issues-processor.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index aa022c0e7..b4b59cc2e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -741,9 +741,9 @@ class IssuesProcessor { } // Should we un-stale this issue? if (shouldRemoveStaleWhenUpdated && - issueHasComments && + (issueHasUpdate || 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`); + issueLogger.info(`Remove the stale label since the $$type has been updated and the workflow should remove the stale label when updated`); yield this._removeStaleLabel(issue, staleLabel); // Are there labels to remove or add when an issue is no longer stale? yield this._removeLabelsWhenUnstale(issue, labelsToRemoveWhenUnstale); diff --git a/src/classes/issues-processor.ts b/src/classes/issues-processor.ts index 9cb1bb23f..1ddbadbd2 100644 --- a/src/classes/issues-processor.ts +++ b/src/classes/issues-processor.ts @@ -674,11 +674,11 @@ export class IssuesProcessor { // Should we un-stale this issue? if ( shouldRemoveStaleWhenUpdated && - issueHasComments && + (issueHasUpdate || 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` + `Remove the stale label since the $$type has been updated and the workflow should remove the stale label when updated` ); await this._removeStaleLabel(issue, staleLabel);