[release-sdk-changesets] Fix secrets context usage#172
Conversation
GitHub Actions doesnt allow the `secrets` context in `if` expressions for reusable workflows. This caused a workflow parse error.
|
pnpm exec changesetto create a changeset. |
Coverage report
Test suite run success15 tests passing in 7 suites. Report generated by 🧪jest coverage report action from 1f1c3be Show full coverage report
|
There was a problem hiding this comment.
Pull request overview
This PR fixes a GitHub Actions reusable-workflow parsing failure by removing use of the secrets context inside a step-level if: expression and instead validating the secret inside the step’s run: script after passing it via env: (where secrets is supported).
Changes:
- Replaced the step-level
if: ${{ secrets.RUNNER_APP_PRIVATE_KEY == '' }}guard with anenv:assignment ofRUNNER_APP_PRIVATE_KEY. - Added an inline shell validation (
if [ -z "$RUNNER_APP_PRIVATE_KEY" ]; then ... exit 1) to fail fast when the secret is missing.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
secretscontext in a step-levelifcondition, which is not supported in reusable workflowsRUNNER_APP_PRIVATE_KEYvalidation into therunblock, passing the secret throughenv:where thesecretscontext is allowedThis caused all downstream SDK repos using
release-sdk-changesets.ymlto fail with: