Skip to content

Commit

Permalink
Repo gardening: don't send slack notifs for closed issues
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve committed Jan 17, 2025
1 parent 6faf866 commit 434191b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Significance: patch
Type: changed
Comment: Issue Triage: do not send Slack notifications for closed issues


Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand All @@ -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;
}

Expand Down

0 comments on commit 434191b

Please sign in to comment.