ci: notify Slack for PyPI approval#84
Merged
Merged
Conversation
The `if: env.SLACK_WEBHOOK_URL != ''` guard read a step-level env var, which GitHub does not expose to that same step's `if` (only workflow/job env is visible). The gate always evaluated empty, so notify-approval, notify-success, and notify-failure always took the skip branch and never posted to Slack. Hoist SLACK_WEBHOOK_URL to job-level env on all three jobs so the gate resolves. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
podonos-eunseo
approved these changes
Jul 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds an
@channelSlack approval card to the PyPI promote lane, and fixes anotification gate bug found in review.
Feature (
promote-prod.yml,docs/PUBLISH.md,RUNBOOK.md)notify-approvaljob posts a Slack Block Kit card once a validatedrelease artifact is built: package version, release tag, repository, trigger
type, and an Approve in GitHub button linking to the exact Actions run.
pypienvironment remains the sole approval gate. Slack isnotification-only and best-effort — a delivery failure cannot change the
publish decision. Silent on idempotent no-ops.
Fix (this branch, commit
872e987)if: env.SLACK_WEBHOOK_URL != ''whiledefining
SLACK_WEBHOOK_URLonly at the step level. GitHub does not expose astep's own
env:to that same step'sif(only workflow/job env is visible),so the gate always read empty and every notify job took the skip branch —
the card would never have posted. Hoisted
SLACK_WEBHOOK_URLto job-levelenvonnotify-approval,notify-success, andnotify-failure.Review
/code-review(xhigh): 1 confirmed correctness bug (the env gate above),now fixed. Verified against GitHub's contexts docs. Remaining items were
low/non-blocking (parallel notify/pypi timing race — accepted; mutable
slackapi/slack-github-action@v3pin — deferred to a separate hardening PR).Test plan
actionlint .github/workflows/*.ymlcleanpypienvironment (cannot run from a feature branch)🤖 Generated with Claude Code