You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(actions): preserve credentials with $ in setup action env vars (#532)
The setup action's 'Set environment variables' step wrote each credential to
$GITHUB_ENV with an inline-interpolated echo (echo "VAR=${{ inputs.* }}").
GitHub substitutes the expression into the script text before bash runs, so
bash then re-expanded any $WORD/$$/$(...) in the resulting double-quoted
string — silently corrupting any credential containing '$' (e.g. an
auto-generated WebDAV access key like abc$FOO123) and surfacing downstream as
an unexplained 401 on the WebDAV PUT. The guards had the same flaw plus a
shell-injection vector.
All inputs now flow through the step's env: block (IN_*) and are written via a
set_env() helper using GitHub's heredoc env syntax (NAME<<DELIM ... DELIM) with
a per-run random delimiter — the same mechanism @actions/core uses. Values are
emitted with printf as arguments, so $, %, quotes, backticks, $(...), = and
embedded newlines are all preserved byte-for-byte with no shell, printf, or
$GITHUB_ENV-format reinterpretation. selfsigned keeps its true/1 guard.
Adds a setup-special-char-credentials regression job to test-actions.yml that
round-trips $-bearing credentials (including a renamed input, short-code ->
SFCC_SHORTCODE) and asserts byte-for-byte preservation.
W-23178876
Fix the `setup` GitHub Action silently corrupting any credential that contains a `$` (for example an auto-generated WebDAV access key like `abc$FOO123`). The action wrote credentials to the job environment with an inline-interpolated `echo`, so bash re-expanded `$WORD` sequences and stripped them — the altered credential then failed downstream WebDAV auth with an unexplained 401. Credentials are now passed through the step's `env` block and written with GitHub's heredoc env syntax, so values containing `$`, quotes, backticks, `$(...)`, `=`, or even newlines reach the CLI byte-for-byte. No workflow changes are required; re-run with the fixed action version.
0 commit comments