Repository navigation
Description
Bug
Workflow environment validation recognizes the whole github context and github.token as credential-bearing, but not a wildcard projection of the same context. This leaves an inconsistent classification for expressions such as ${{ github.* }} and ${{ toJSON(github.*) }}.
This is a residual case after #76633, not a request to repeat that fix: the current implementation already recognizes all secrets-rooted paths, including wildcard paths. Ordinary vars references should not be classified as credentials merely because they use a wildcard.
Current source behavior
Verified against main revision f9f49d837a9bc5feec59a29e71ee77bc7545905c:
Reference()in access.go:22–41 resolvesgithub.*to the static path["github", "*"].isCredentialReference()in credential_free_prompt.go:21–25 recognizessecretsprefixes,github.tokenprefixes, and the exact path["github"], but not["github", "*"].expressionUsesCredentialReference():39–52stops walking below a resolved static reference, so it does not subsequently classify the underlyinggithubcontext.- Workflow
envvalidation uses that shared classifier instrict_mode_env_validation.go.
An earlier CLI v1.2.2 compilation accepted env: { SNAPSHOT: '${{ github.* }}' }. The current-main evidence here is source tracing, not a fresh full-CLI reproduction. No live Actions evaluation was performed; this issue does not claim that assigning an array directly to env is accepted at runtime or demonstrate any runtime value disclosure.
Suggested correction
Extend the shared credential-reference classifier to conservatively recognize wildcard projections that can select the credential-bearing members of the github context. Keep the distinction between that context-wide projection and named non-credential fields such as github.repository or projections over unrelated non-credential objects.
Use the existing strict-mode rejection/non-strict warning paths rather than changing the AST resolver's general handling of wildcards, which is also needed for valid expressions such as needs.*.result. Preserve supported engine-specific credential bindings and the existing handling of secrets.*.
Regression coverage
- Assert credential classification for
github.*, grouped/case-equivalent forms supported by the parser, andtoJSON(github.*). - Exercise top-level workflow
envand non-exemptengine.env: strict mode rejects these expressions without creating or overwriting a lock file; non-strict mode emits the existing warning. - Preserve rejection of direct
github.token, whole-contextgithub, andsecrets.*/secrets.*.valuereferences. - Preserve acceptance of safe named GitHub fields, quoted expression-like text, ordinary
varsvalues, and unrelated wildcard expressions. - Separately document or test Actions evaluation semantics with synthetic values before making runtime claims.
Activity