From e1cf8a5d54b4ff316c76f5356079d3a8df84137e Mon Sep 17 00:00:00 2001 From: Ashish Dhingra <67916761+ashishdhingra@users.noreply.github.com> Date: Fri, 8 Apr 2022 11:03:17 -0700 Subject: [PATCH] Skip marking issue as stale if the stale message is empty. (#142) --- src/entrypoint.js | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/entrypoint.js b/src/entrypoint.js index 3497f3c..131e5f2 100644 --- a/src/entrypoint.js +++ b/src/entrypoint.js @@ -182,13 +182,18 @@ async function processIssues(client, args) { } } else { if (currentTime >= rrTime) { - log.debug(`time expired on this issue, need to label it stale`); - if (args.dryrun) { - log.info( - `dry run: would mark #${issue.number} as ${staleLabel} due to ${responseRequestedLabel} age` - ); - } else { - await markStale(client, issue, staleMessage, staleLabel); + if (staleMessage) { + log.debug(`time expired on this issue, need to label it stale`); + if (args.dryrun) { + log.info( + `dry run: would mark #${issue.number} as ${staleLabel} due to ${responseRequestedLabel} age` + ); + } else { + await markStale(client, issue, staleMessage, staleLabel); + } + } + else { + log.debug(`stale message is null/empty, doing nothing`); } } else { // else ignore it because we need to wait longer before staleing