Skip to content

Commit

Permalink
Repo gardening: don't send slack notifs for closed issues (#41165)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve authored and matticbot committed Jan 22, 2025
1 parent 83fd36f commit 6d55f28
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50137,7 +50137,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 @@ -50164,9 +50164,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
2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/tasks/gather-support-references/index.js
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 6d55f28

Please sign in to comment.