fix(ci): claude review workflow never triggered due to secrets in step if - #16018
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes the Claude PR review GitHub Actions workflow so it can be parsed and triggered properly by removing use of the secrets context in a step-level if: expression. It does this by surfacing ANTHROPIC_API_KEY via the env context and then checking env.ANTHROPIC_API_KEY in the step condition.
Changes:
- Add job-level
env.ANTHROPIC_API_KEYsourced from${{ secrets.ANTHROPIC_API_KEY }}. - Update the Claude review step to gate on
env.ANTHROPIC_API_KEYand pass the key viaenvinstead ofsecrets.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #16018 +/- ##
==========================================
- Coverage 73.05% 73.04% -0.02%
==========================================
Files 856 856
Lines 186825 186825
Branches 186825 186825
==========================================
- Hits 136482 136462 -20
- Misses 45975 45991 +16
- Partials 4368 4372 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Pull request overviewThe Changes:
Reviewed changesPer-file summary
FindingsNo blocking issues. Notes on the fix:
✅ Approved |
The claude PR review workflow added in #15996 never ran: the
secretscontext is not allowed in step-levelif:expressions, which made the whole workflow file invalid. GitHub could not parse it, so every push produced a failed zero-job stub run and the actualpull_request/issue_commenttriggers never fired.Expose
ANTHROPIC_API_KEYthrough job-levelenv(where thesecretscontext is allowed) and checkenv.ANTHROPIC_API_KEYin the step condition instead. Validated with actionlint.