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
{{ message }}
Repository navigation
Commit bf3e795
Browse filesBrowse the repository at this point in the historyBrowse files
fix(cli): fail when --secrets-file can't be read or parsed
A missing or unparsable --secrets-file was ignored: up,
run-user-commands and build ran with no secrets injected or masked and
could exit 0.
As the reference CLI's readSecretsFromFile, the file is now read once,
before anything else, and a failure ends the command with
{"outcome":"error","message":<Node's fs error or "Invalid json
data">,"description":"Failed to read/parse secrets"} and exit 1. The
file is parsed as jsonc.parse does: comments and any JSON value are
accepted, and trailing commas, a BOM and trailing data are not. Values
become env vars as JS String() makes them, in JS key order. build,
whose --secrets-file the reference lacks, fails the same way.
Eight hermetic parity cases compare the error and acceptance paths
with the reference for up and run-user-commands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
notes: "readSecretsFromFile throws ContainerError{description: 'Failed to read/parse secrets'} with Node's ENOENT message, before the configuration is looked up. Go used to ignore an unreadable file and run with no secrets."
notes: "jsonc.parse reports a trailing comma as a parse error, so the message is 'Invalid json data'. Go used to ignore a malformed file and run with no secrets."
notes: "jsonc.parse accepts comments and non-string values, so the command gets past the secrets file to the configuration lookup. Go json.Unmarshal into map[string]string used to reject non-string values."
notes: "readSecretsFromFile throws ContainerError{description: 'Failed to read/parse secrets'} with Node's ENOENT message, before the configuration is looked up. Go used to ignore an unreadable file and run with no secrets."
notes: "jsonc.parse reports a trailing comma as a parse error, so the message is 'Invalid json data'. Go used to ignore a malformed file and run with no secrets."
notes: "jsonc.parse accepts comments and non-string values, so the command gets past the secrets file to the configuration lookup. Go json.Unmarshal into map[string]string used to reject non-string values."
returnwriteErrorJSON(out, coreerrors.ToErrorOutput(&coreerrors.ContainerError{Description: "An error occurred running user commands in the container.", OriginalError: err}))
0 commit comments