Skip to content

fix(ci): skip Slack notify steps when SLACK_WEBHOOK_URL is unset - #431

Closed
tommaso-castellani wants to merge 1 commit into
mainfrom
fix/shadcn-slack-guard
Closed

fix(ci): skip Slack notify steps when SLACK_WEBHOOK_URL is unset#431
tommaso-castellani wants to merge 1 commit into
mainfrom
fix/shadcn-slack-guard

Conversation

@tommaso-castellani

Copy link
Copy Markdown
Contributor

Problem

The three Notify Slack steps in .github/workflows/shadcn.yml curl the webhook unguarded:

curl -X POST --data "{...}" ${{ secrets.SLACK_WEBHOOK_URL }}

This repo has SLACK_WEBHOOK_URL set, so it stays green and the bug is invisible here. Every repo cloned from this template does not have it. There, the URL expands to nothing, curl exits 2 (curl: (2) no URL specified), and the run is marked failed — even when the shadcn update itself worked perfectly.

Four downstream repos have been failing this way every single day for over a week (template-test, template-clone, cardinal-core-sync-replay, dive-the-plan). On template-test the workflow did its whole job correctly, found an already-open PR, and then died posting to Slack.

Fix

  • Lift the secret to a job-level env.SLACK_WEBHOOK_URL.
  • Guard each notify step with env.SLACK_WEBHOOK_URL != '' so it self-skips when the secret is absent.
  • Quote the URL in the curl call.

Behaviour in this repo is unchanged (the secret is set, so all three steps still fire). Repos without the secret now simply skip the notification instead of failing the run.

Same patch already applied to tommaso-castellani/dive-the-plan.

The three notify steps curl ${{ secrets.SLACK_WEBHOOK_URL }} unguarded. This repo
has the secret so it stays green, but every repo cloned from this template does
not: the URL expands to empty, curl exits 2 ('no URL specified'), and the run is
marked failed even when the shadcn update succeeded. Guard each step on a
non-empty webhook and quote the URL.

@nsosio nsosio left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

do we still use this flow? can we drop it completely?

@tommaso-castellani

tommaso-castellani commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

Superseded — @nsosio asked to drop the shadcn workflow from the template entirely, so guarding the Slack steps is moot here. Closing in favour of a PR that removes .github/workflows/shadcn.yml.

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