Skip to content

feat(ci): add Slack failure notifications#151

Open
wyattjoh wants to merge 3 commits intomainfrom
wyattjoh/slack-notifications
Open

feat(ci): add Slack failure notifications#151
wyattjoh wants to merge 3 commits intomainfrom
wyattjoh/slack-notifications

Conversation

@wyattjoh
Copy link
Copy Markdown
Contributor

Summary

  • Add scripts/slack.ts that posts block-kit formatted failure messages to a Slack incoming webhook
  • Extract a reusable notify-failure.yml workflow to keep notification steps DRY across CI, stable release, and canary release pipelines

Requirements

Requires a SLACK_WEBHOOK_URL repository secret.

Test plan

  • Verify notify-failure.yml is triggered when a CI job fails
  • Verify Slack message format renders correctly
  • Confirm no regressions in existing CI or release workflows

@wyattjoh
Copy link
Copy Markdown
Contributor Author

Stack: slack-notifications

Part of a stacked PR chain. Do not merge manually.

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 13, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Added a reusable GitHub Actions workflow .github/workflows/notify-failure.yml callable via workflow_call that accepts a required workflow-name input and a required SLACK_WEBHOOK_URL secret, checks out the repo, sets up Bun, installs dependencies, and runs bun scripts/slack.ts --status failure. Updated .github/workflows/release.yml to add notify-stable-failure and notify-canary-failure jobs that run the reusable workflow when specified upstream jobs include failures. Added scripts/slack.ts, a Bun script that requires --status, reads WORKFLOW_NAME and SLACK_WEBHOOK_URL from the environment, composes a Slack Block Kit payload with workflow and run metadata, and POSTs it to the webhook with error handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the main change: adding Slack failure notifications to CI workflows.
Description check ✅ Passed The description is clearly related to the changeset, detailing the specific changes made and test requirements.
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.

Comment thread .github/workflows/notify-failure.yml Outdated
Comment thread .github/workflows/notify-failure.yml Outdated
@wyattjoh wyattjoh force-pushed the wyattjoh/slack-notifications branch 2 times, most recently from 546e8d5 to 7d6c0cf Compare April 14, 2026 20:41
Comment on lines +16 to +26
runs-on: blacksmith-2vcpu-ubuntu-2404
timeout-minutes: 5
steps:
- uses: actions/checkout@v6
- uses: oven-sh/setup-bun@v2
- run: bun install --frozen-lockfile
- name: Notify Slack
run: bun scripts/slack.ts --status failure
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
WORKFLOW_NAME: ${{ inputs.workflow-name }}
@wyattjoh wyattjoh force-pushed the wyattjoh/slack-notifications branch from 2503552 to c6b93f8 Compare April 15, 2026 20:06
@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 15, 2026

⚠️ No Changeset found

Latest commit: 21ed234

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

@wyattjoh wyattjoh force-pushed the wyattjoh/slack-notifications branch 2 times, most recently from 0e5c2d0 to f9e59a5 Compare April 15, 2026 22:41
Add scripts/slack.ts that posts block-kit formatted failure messages to
a Slack incoming webhook. Extract a reusable notify-failure.yml workflow
to keep the notification steps DRY across CI, stable release, and canary
release pipelines.

Requires a SLACK_WEBHOOK_URL repository secret.
Slack notifications should only fire for release failures, not on every
pull request CI run.
Move the workflow-name input to a WORKFLOW_NAME env var so it is never
interpolated into the shell. The --status flag remains as a hardcoded
CLI argument since its value is always a literal.
@wyattjoh wyattjoh force-pushed the wyattjoh/slack-notifications branch from f9e59a5 to 21ed234 Compare April 15, 2026 23:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants