ci: add Slack failure notifications to release workflow#8023
ci: add Slack failure notifications to release workflow#8023jacekradko wants to merge 1 commit intomainfrom
Conversation
|
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
📝 WalkthroughWalkthroughThe 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)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
.github/workflows/release.yml
| - 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 |
There was a problem hiding this comment.
🧩 Analysis chain
🏁 Script executed:
# First, let's check the exact structure of the release.yml file
cat -n .github/workflows/release.yml | head -160Repository: 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.
| - 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 |
There was a problem hiding this comment.
🧩 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.
Summary
SDK_SLACKER_WEBHOOK_URLchannel when either release pipeline failsSLACK_CHANGELOG_WEBHOOK_URLis unchangedPrerequisites
SDK_SLACKER_WEBHOOK_URLsecret must be configured in the repo settingsTest plan
SDK_SLACKER_WEBHOOK_URLsecret is setSummary by CodeRabbit