Fix the SDK release safety check - #119
Conversation
EntelligenceAI PR SummaryUpdated the release-doctor workflow to pass flowchart TD
A["Release doctor workflow"] --> B["Check release environment step"]
C["PRODUCTION_REPO_TOKEN secret"] --> B
B --> D["check-release-environment script"]
D --> E["Pass or report missing token"]
classDef newBehavior fill:#dcfce7,stroke:#16a34a,color:#14532d;
class A,B,C,D,E newBehavior;
Review Scorecard
Issues found:
Not safe to merge — the Medium-blast-radius workflow still exposes a production token to PR-controlled code. Although aligning the check with Need to merge before these are addressed? Anyone with write access can comment Evaluated against
Files requiring special attention
|
| env: | ||
| PRODUCTION_REPO_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }} |
There was a problem hiding this comment.
Keep the production token away from PR-controlled code
Because this pull_request job executes the checked-out bin/check-release-environment, a same-repository PR named release-please* or next can replace that script and exfiltrate the newly injected PAT. Keep the check on trusted base code before exposing secrets.
Prompt to fix with AI
Copy this prompt into your AI coding assistant to fix this issue.
In .github/workflows/release-doctor.yml at lines 18-19, prevent PRODUCTION_REPO_TOKEN from being available to code supplied by a pull request. Run the release-environment validation from a trusted base/default-branch revision, or redesign the trigger so the secret is only injected after untrusted PR code cannot execute, while preserving validation for legitimate release-please PRs.
The release workflow uses
PRODUCTION_REPO_TOKEN, but the release-doctor check still looked for the retiredRELEASE_PLEASE_TOKENname and never passed the current secret into the script. This makes the release PR fail even when the real release token is configured. Align the check with the release workflow and expose the secret only to that validation step.\n\nVerified withbash -n, a positive dummy-token run, andgit diff --check.Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.