2121 pull-requests : write
2222 env :
2323 SHOWCASE_BRANCH : main
24+ SLACK_WEBHOOK : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
2425 steps :
2526 - uses : actions/checkout@v4
2627 with :
@@ -364,7 +365,7 @@ jobs:
364365
365366 - name : Notify Slack (auto-sync)
366367 id : notify-auto-sync
367- if : always() && steps.push.outcome == 'success' && steps.push.outputs.files_changed != '0' && steps.push.outputs.needs_review != 'true'
368+ if : always() && env.SLACK_WEBHOOK != '' && steps.push.outcome == 'success' && steps.push.outputs.files_changed != '0' && steps.push.outputs.needs_review != 'true'
368369 uses : slackapi/slack-github-action@v2.1.0
369370 with :
370371 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -373,7 +374,7 @@ jobs:
373374
374375 - name : Notify Slack (merge failed)
375376 id : notify-merge-failed
376- if : failure() && steps.push.outputs.pr_opened == 'true' && steps.push.outputs.needs_review != 'true'
377+ if : failure() && env.SLACK_WEBHOOK != '' && steps.push.outputs.pr_opened == 'true' && steps.push.outputs.needs_review != 'true'
377378 uses : slackapi/slack-github-action@v2.1.0
378379 with :
379380 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -387,7 +388,7 @@ jobs:
387388 # PR URL (not on any error path that leaves pr_url empty).
388389 - name : Notify Slack (review needed, with PR)
389390 id : notify-review-with-pr
390- if : always() && steps.push.outputs.needs_review == 'true' && steps.push.outputs.pr_opened == 'true'
391+ if : always() && env.SLACK_WEBHOOK != '' && steps.push.outputs.needs_review == 'true' && steps.push.outputs.pr_opened == 'true'
391392 uses : slackapi/slack-github-action@v2.1.0
392393 with :
393394 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -400,7 +401,7 @@ jobs:
400401 # the existing-PR collision path, which gets its own step below.
401402 - name : Notify Slack (review needed, no PR)
402403 id : notify-review-no-pr
403- if : always() && steps.sync.outputs.action == 'push_and_pr' && steps.push.outputs.pr_opened == 'false' && steps.push.outputs.existing_pr != 'true'
404+ if : always() && env.SLACK_WEBHOOK != '' && steps.sync.outputs.action == 'push_and_pr' && steps.push.outputs.pr_opened == 'false' && steps.push.outputs.existing_pr != 'true'
404405 uses : slackapi/slack-github-action@v2.1.0
405406 with :
406407 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -411,7 +412,7 @@ jobs:
411412 # needs-review PR already exists — point reviewers at it.
412413 - name : Notify Slack (review needed, existing PR)
413414 id : notify-review-existing-pr
414- if : always() && steps.push.outputs.existing_pr == 'true'
415+ if : always() && env.SLACK_WEBHOOK != '' && steps.push.outputs.existing_pr == 'true'
415416 uses : slackapi/slack-github-action@v2.1.0
416417 with :
417418 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -420,7 +421,7 @@ jobs:
420421
421422 - name : Notify Slack (failure)
422423 id : notify-failure
423- if : failure() && steps.push.outputs.pr_opened != 'true'
424+ if : failure() && env.SLACK_WEBHOOK != '' && steps.push.outputs.pr_opened != 'true'
424425 uses : slackapi/slack-github-action@v2.1.0
425426 with :
426427 webhook : ${{ secrets.SLACK_WEBHOOK_OSS_ALERTS }}
@@ -440,7 +441,7 @@ jobs:
440441 # values cannot contain " or \.
441442 - name : Notify Slack (alert machinery failed)
442443 if : >-
443- always() && (
444+ always() && env.SLACK_WEBHOOK != '' && (
444445 steps.notify-auto-sync.outcome == 'failure' ||
445446 steps.notify-merge-failed.outcome == 'failure' ||
446447 steps.notify-review-with-pr.outcome == 'failure' ||
0 commit comments