From 434191bc17f45bf6c5e75583d3a2f1c57b892f1b Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Fri, 17 Jan 2025 19:23:11 +0100 Subject: [PATCH] Repo gardening: don't send slack notifs for closed issues --- ...e-repo-gardening-no-slack-customer-warnings-closed-issues | 5 +++++ .../src/tasks/gather-support-references/index.js | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 projects/github-actions/repo-gardening/changelog/update-repo-gardening-no-slack-customer-warnings-closed-issues diff --git a/projects/github-actions/repo-gardening/changelog/update-repo-gardening-no-slack-customer-warnings-closed-issues b/projects/github-actions/repo-gardening/changelog/update-repo-gardening-no-slack-customer-warnings-closed-issues new file mode 100644 index 0000000000000..d3f916844efa8 --- /dev/null +++ b/projects/github-actions/repo-gardening/changelog/update-repo-gardening-no-slack-customer-warnings-closed-issues @@ -0,0 +1,5 @@ +Significance: patch +Type: changed +Comment: Issue Triage: do not send Slack notifications for closed issues + + diff --git a/projects/github-actions/repo-gardening/src/tasks/gather-support-references/index.js b/projects/github-actions/repo-gardening/src/tasks/gather-support-references/index.js index 4ec7836ab1ea5..59aaa874607df 100644 --- a/projects/github-actions/repo-gardening/src/tasks/gather-support-references/index.js +++ b/projects/github-actions/repo-gardening/src/tasks/gather-support-references/index.js @@ -414,7 +414,7 @@ async function createOrUpdateComment( payload, octokit, issueReferences, issueCo */ async function addHappinessLabel( payload, octokit ) { const { - issue: { number }, + issue: { number, state }, repository: { name: repo, owner: { login: ownerLogin }, @@ -441,9 +441,10 @@ async function addHappinessLabel( payload, octokit ) { // Send Slack notification, if we have the necessary tokens. // No Slack tokens, we won't be able to escalate. Bail. + // If the issue is already closed, do not send any Slack reminder. const slackToken = getInput( 'slack_token' ); const channel = getInput( 'slack_quality_channel' ); - if ( ! slackToken || ! channel ) { + if ( ! slackToken || ! channel || state === 'closed' ) { return false; }