Skip to content

ci: add Slack failure notifications to release workflow#8023

Open
jacekradko wants to merge 1 commit intomainfrom
jacek/release-slack-notifications
Open

ci: add Slack failure notifications to release workflow#8023
jacekradko wants to merge 1 commit intomainfrom
jacek/release-slack-notifications

Conversation

@jacekradko
Copy link
Member

@jacekradko jacekradko commented Mar 10, 2026

Summary

  • Adds Slack failure notifications to the release workflow for both stable and canary release jobs
  • Sends a message to the SDK_SLACKER_WEBHOOK_URL channel when either release pipeline fails
  • Includes repo, workflow name, commit SHA, who triggered it, and a link to the logs
  • Existing success notification to SLACK_CHANGELOG_WEBHOOK_URL is unchanged
  • Snapshot release job is excluded (feedback is provided via PR comments)

Prerequisites

  • The SDK_SLACKER_WEBHOOK_URL secret must be configured in the repo settings

Test plan

  • Verify SDK_SLACKER_WEBHOOK_URL secret is set
  • Confirm no notification on successful stable release
  • Confirm no notification on successful canary release
  • Simulate a failure and confirm Slack notification is received with correct details

Summary by CodeRabbit

  • Chores
    • Enhanced release workflow with failure notifications to improve release monitoring and visibility.

@changeset-bot
Copy link

changeset-bot bot commented Mar 10, 2026

⚠️ No Changeset found

Latest commit: 3c4d922

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Mar 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
clerk-js-sandbox Ready Ready Preview, Comment Mar 10, 2026 3:33pm

Request Review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 10, 2026

📝 Walkthrough

Walkthrough

The pull request adds Slack failure notifications to the release workflow. Three new notification steps are introduced to the workflow file: one for stable release failures and two for canary release failures. Each step uses the Slack GitHub Action (v1.24.0) to send notifications via webhook. The notifications include details such as repository, workflow name, commit information, actor, and run logs. The webhook URL is configured through the SDK_SLACKER_WEBHOOK_URL secret and SLACK_WEBHOOK_URL environment variable.

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately and concisely describes the main change: adding Slack failure notifications to the release workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.github/workflows/release.yml:
- Around line 227-245: The Slack notification step ("Notify Slack on failure")
currently fires on any workflow failure and can mislabel dispatch failures as
"Canary release failed"; fix by either moving the "Notify Slack on failure" step
to immediately after the "Canary release" step (so it runs only in that context)
or change its condition to target the canary publish step outcome (for example
use if: steps.publish.outcome == 'failure' where "publish" is the id of the
"Canary release" step) so the message is only sent when the actual canary
release fails.
- Around line 128-146: The Slack "Notify Slack on failure" step currently uses a
global `if: failure()` which triggers on any downstream/post-step failures;
update the condition to check the specific step outcome instead: for the stable
release notification replace `if: failure()` with `if: steps.changesets.outcome
== 'failure'` (referencing the `changesets` step), and for the canary release
notification replace `if: failure()` with `if: steps.publish.outcome ==
'failure'` (referencing the `publish` step) so the alert only fires when the
actual release step fails.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 26c67838-46c2-4211-96ff-ef8e1dbd0aad

📥 Commits

Reviewing files that changed from the base of the PR and between 1f43bf7 and 3c4d922.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

Comment on lines +128 to +146
- name: Notify Slack on failure
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*:red_circle: Stable release failed*\n*Repo:* `${{ github.repository }}`\n*Workflow:* `${{ github.workflow }}`\n*Commit:* `${{ github.sha }}`\n*Triggered by:* `${{ github.actor }}`\n*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View logs>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SDK_SLACKER_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

# First, let's check the exact structure of the release.yml file
cat -n .github/workflows/release.yml | head -160

Repository: clerk/javascript

Length of output: 6994


🏁 Script executed:

# Check the canary-release job and its failure notification
cat -n .github/workflows/release.yml | sed -n '148,250p'

Repository: clerk/javascript

Length of output: 4753


Gate the failure notification on the actual release step outcome.

The if: failure() condition fires on failures from post-release side effects (lines 113-126 for stable, lines 195-225 for canary), producing false-positive "release failed" alerts even when the publish succeeded. For the stable release job, change if: failure() to if: steps.changesets.outcome == 'failure'; for the canary job, use if: steps.publish.outcome == 'failure'.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 128 - 146, The Slack "Notify
Slack on failure" step currently uses a global `if: failure()` which triggers on
any downstream/post-step failures; update the condition to check the specific
step outcome instead: for the stable release notification replace `if:
failure()` with `if: steps.changesets.outcome == 'failure'` (referencing the
`changesets` step), and for the canary release notification replace `if:
failure()` with `if: steps.publish.outcome == 'failure'` (referencing the
`publish` step) so the alert only fires when the actual release step fails.

Comment on lines +227 to +245
- name: Notify Slack on failure
if: failure()
uses: slackapi/slack-github-action@v1.24.0
with:
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "*:red_circle: Canary release failed*\n*Repo:* `${{ github.repository }}`\n*Workflow:* `${{ github.workflow }}`\n*Commit:* `${{ github.sha }}`\n*Triggered by:* `${{ github.actor }}`\n*Run:* <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View logs>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SDK_SLACKER_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n .github/workflows/release.yml | sed -n '180,250p'

Repository: clerk/javascript

Length of output: 3440


The Slack notification will misreport dispatch failures as canary release failures.

Line 195's "Trigger workflows on related repos" step runs only when the canary release succeeds. If that dispatch step fails, the notification at line 227 will still trigger with the message "Canary release failed"—but the actual release (pnpm release:canary) already succeeded. This creates a misleading alert. Place the Slack notification immediately after the "Canary release" step (line 191), or restrict its condition to if: steps.publish.outcome == 'failure' so it only fires for actual release failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/release.yml around lines 227 - 245, The Slack notification
step ("Notify Slack on failure") currently fires on any workflow failure and can
mislabel dispatch failures as "Canary release failed"; fix by either moving the
"Notify Slack on failure" step to immediately after the "Canary release" step
(so it runs only in that context) or change its condition to target the canary
publish step outcome (for example use if: steps.publish.outcome == 'failure'
where "publish" is the id of the "Canary release" step) so the message is only
sent when the actual canary release fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant