Environment Parsing#1156
Conversation
…loitable `git config` operations.
… and setting config by environment variable
🦋 Changeset detectedLatest commit: 0ab6c5b The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| * and environment variables. | ||
| */ | ||
| export function vulnerabilityCheck(tokens: readonly string[], env: Record<string, unknown>) { | ||
| return [...parseArgv(...tokens).vulnerabilities, ...parseEnv(env).vulnerabilities]; |
There was a problem hiding this comment.
👋 @steveukx! I'm getting this error after lockfile maintenance over the weekend:
Error: TypeError: parsed.vulnerabilities.vulnerabilities is not iterable
This happened because direct dependency simple-git stayed on 3.35.2 but transient dependency @simple-git/argv-parser upgraded from 1.0.3 to 1.1.0. It was still within the allowed semever range for simple-git@3.35.2 ("@simple-git/argv-parser": "^1.0.3").
So technically there is a breaking change between @simple-git/argv-parser 1.0.x and 1.1.0 which is a bug, according to semver.
I bumped simple-git from 3.35.2 to 3.36.0 and it resolved the above error. But I guess that new installs for simple-git <3.36.0 will be broken now.
There was a problem hiding this comment.
|
Hi @steveukx, thx for this update, I think it's definitely an improvement. const git = simpleGit({
baseDir: gitFolder,
binary: 'git',
maxConcurrentProcesses: 6,
trimmed: false,
config: ['credential.helper=credential.helper="!f(){ printf 'username=%s\npassword=%s\n' "$USERNAME" "$PASSWORD" };f"', 'credential.useHttpPath=true'],
}).env('GIT_TERMINAL_PROMPT', '0')After updating to See n8n-io/n8n#29943 The same goes for ssh and const sshCommand = `ssh -o UserKnownHostsFile="${escapedKnownHostsPath}" -o StrictHostKeyChecking=accept-new -i "${escapedPrivateKeyPath}"`
const git = simpleGit({
baseDir: gitFolder,
binary: 'git',
maxConcurrentProcesses: 6,
trimmed: false,
})
.env('GIT_SSH_COMMAND', sshCommand)
.env('GIT_TERMINAL_PROMPT', '0');What do you think of bumping the package to 4.0 to help avoid people who update running into this? |
No description provided.