Skip to content

Fix invalid use of secrets context in step-level if expression#14

Merged
gsavage merged 1 commit into
mainfrom
fix-incorrect-use-of-secrets
May 20, 2026
Merged

Fix invalid use of secrets context in step-level if expression#14
gsavage merged 1 commit into
mainfrom
fix-incorrect-use-of-secrets

Conversation

@gsavage

@gsavage gsavage commented May 20, 2026

Copy link
Copy Markdown
Contributor

GitHub Actions does not expose the secrets context inside step-level if: expressions, so referencing secrets.github_token there caused the workflow to fail to parse with "Unrecognized named-value: 'secrets'".

Map the secret to a step-scoped env.GH_TOKEN and gate the step on the env var instead. The run block now consumes the token via the env var rather than interpolating the secret directly into the shell command.

GitHub Actions does not expose the `secrets` context inside step-level
`if:` expressions, so referencing `secrets.github_token` there caused
the workflow to fail to parse with "Unrecognized named-value: 'secrets'".

Map the secret to a step-scoped `env.GH_TOKEN` and gate the step on the
env var instead. The `run` block now consumes the token via the env var
rather than interpolating the secret directly into the shell command.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@gsavage gsavage force-pushed the fix-incorrect-use-of-secrets branch from 6da40de to 5575e94 Compare May 20, 2026 18:18
@gsavage gsavage merged commit b599c4e into main May 20, 2026
1 check passed
@gsavage gsavage deleted the fix-incorrect-use-of-secrets branch May 20, 2026 18:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant