Read-only mirror — the public repositories of the Forgejo instance, refreshed every 10 minutes. The live instance (fg.dieschoenewolke.de) is reachable only over the VPN; clone here with https://git.dieschoenewolke.de/git/<owner>/<repo>.git.
summaryrefslogtreecommitdiff
path: root/dist/index.js
diff options
context:
space:
mode:
authorJok <67024248+jokreliable@users.noreply.github.com>2022-11-15 18:51:19 -0800
committerGitHub <noreply@github.com>2022-11-15 21:51:19 -0500
commit20ea791f28338e46bf15fd7510c68b4bea790a93 (patch)
tree47c822d8a78aa10abf12447af95fbb09442f38cb /dist/index.js
parenta136c19d618b41934fcbe9a7e1b64a79739372eb (diff)
wrap pipeline commands for submoduleForeach in quotes (#964)
* wrap pipeline commands for submoduleForeach in quotes * Update src/git-auth-helper.ts drop extraneous space. Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com> * Followed CONTRIBUTING.md instructions, updating dist/index.js * fixed package-lock.json * updating the pipeline so it runs from sh Co-authored-by: Josh Soref <2119212+jsoref@users.noreply.github.com>
Diffstat (limited to 'dist/index.js')
-rw-r--r--dist/index.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/dist/index.js b/dist/index.js
index 63072b8..47a99f1 100644
--- a/dist/index.js
+++ b/dist/index.js
@@ -7121,7 +7121,9 @@ class GitAuthHelper {
// Configure a placeholder value. This approach avoids the credential being captured
// by process creation audit events, which are commonly logged. For more information,
// refer to https://docs.microsoft.com/en-us/windows-server/identity/ad-ds/manage/component-updates/command-line-process-auditing
- const output = yield this.git.submoduleForeach(`git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url`, this.settings.nestedSubmodules);
+ const output = yield this.git.submoduleForeach(
+ // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
+ `sh -c "git config --local '${this.tokenConfigKey}' '${this.tokenPlaceholderConfigValue}' && git config --local --show-origin --name-only --get-regexp remote.origin.url"`, this.settings.nestedSubmodules);
// Replace the placeholder
const configPaths = output.match(/(?<=(^|\n)file:)[^\t]+(?=\tremote\.origin\.url)/g) || [];
for (const configPath of configPaths) {
@@ -7288,7 +7290,9 @@ class GitAuthHelper {
}
}
const pattern = regexpHelper.escape(configKey);
- yield this.git.submoduleForeach(`git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :`, true);
+ yield this.git.submoduleForeach(
+ // wrap the pipeline in quotes to make sure it's handled properly by submoduleForeach, rather than just the first part of the pipeline
+ `sh -c "git config --local --name-only --get-regexp '${pattern}' && git config --local --unset-all '${configKey}' || :"`, true);
});
}
}