mirror of
https://github.com/actions/checkout.git
synced 2025-09-15 17:14:05 +07:00
Take global core.sshCommand into consideration
This commit is contained in:
14
dist/index.js
vendored
14
dist/index.js
vendored
@ -7253,7 +7253,9 @@ class GitAuthHelper {
|
||||
stateHelper.setSshKnownHostsPath(this.sshKnownHostsPath);
|
||||
yield fs.promises.writeFile(this.sshKnownHostsPath, knownHosts);
|
||||
// Configure GIT_SSH_COMMAND
|
||||
const sshPath = yield io.which('ssh', true);
|
||||
const sshPath = (yield this.git.configExists(SSH_COMMAND_KEY, true))
|
||||
? yield this.git.configGet(SSH_COMMAND_KEY, true)
|
||||
: yield io.which('ssh', true);
|
||||
this.sshCommand = `"${sshPath}" -i "$RUNNER_TEMP/${path.basename(this.sshKeyPath)}"`;
|
||||
if (this.settings.sshStrict) {
|
||||
this.sshCommand += ' -o StrictHostKeyChecking=yes -o CheckHostIP=no';
|
||||
@ -7533,6 +7535,16 @@ class GitCommandManager {
|
||||
return output.exitCode === 0;
|
||||
});
|
||||
}
|
||||
configGet(configKey, globalConfig) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const output = yield this.execGit([
|
||||
'config',
|
||||
globalConfig ? '--global' : '--local',
|
||||
configKey
|
||||
]);
|
||||
return output.stdout.trim();
|
||||
});
|
||||
}
|
||||
fetch(refSpec, fetchDepth) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const args = ['-c', 'protocol.version=2', 'fetch'];
|
||||
|
Reference in New Issue
Block a user