mirror of
https://github.com/webfactory/ssh-agent.git
synced 2024-11-27 11:13:56 +00:00
Use SSH_AUTH_SOCK in following ssh-add invocations
This commit is contained in:
parent
88bcf9af86
commit
7d6e731f4a
2 changed files with 4 additions and 2 deletions
3
dist/index.js
vendored
3
dist/index.js
vendored
|
@ -166,6 +166,7 @@ try {
|
||||||
const matches = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(lines[lineNumber])
|
const matches = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(lines[lineNumber])
|
||||||
if (matches && matches.length > 0) {
|
if (matches && matches.length > 0) {
|
||||||
core.exportVariable(matches[1], matches[2])
|
core.exportVariable(matches[1], matches[2])
|
||||||
|
process.env[matches[1]] = matches[2]; // use variables for ssh-add below
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -195,7 +196,7 @@ try {
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
child_process.execFileSync('ssh-add', [keyFile], { env: { ...process.env, ...{ 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'D:\\a\\ssh-agent\\ssh-agent\\askpass.exe' } } });
|
child_process.execFileSync('ssh-add', [keyFile], { env: { ...process.env, ...{ 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'D:\\a\\ssh-agent\\ssh-agent\\askpass.exe' } } });
|
||||||
} else {
|
} else {
|
||||||
child_process.execFileSync('ssh-add', [keyFile], { input: token });
|
child_process.execFileSync('ssh-add', [keyFile], { env: process.env, input: token });
|
||||||
}
|
}
|
||||||
|
|
||||||
output.toString().split(/\r?\n/).forEach(function(key) {
|
output.toString().split(/\r?\n/).forEach(function(key) {
|
||||||
|
|
3
index.js
3
index.js
|
@ -49,6 +49,7 @@ try {
|
||||||
const matches = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(lines[lineNumber])
|
const matches = /^(SSH_AUTH_SOCK|SSH_AGENT_PID)=(.*); export \1/.exec(lines[lineNumber])
|
||||||
if (matches && matches.length > 0) {
|
if (matches && matches.length > 0) {
|
||||||
core.exportVariable(matches[1], matches[2])
|
core.exportVariable(matches[1], matches[2])
|
||||||
|
process.env[matches[1]] = matches[2]; // use variables for ssh-add below
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,7 +79,7 @@ try {
|
||||||
if (isWindows) {
|
if (isWindows) {
|
||||||
child_process.execFileSync('ssh-add', [keyFile], { env: { ...process.env, ...{ 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'D:\\a\\ssh-agent\\ssh-agent\\askpass.exe' } } });
|
child_process.execFileSync('ssh-add', [keyFile], { env: { ...process.env, ...{ 'DISPLAY': 'fake', 'SSH_PASS': token, 'SSH_ASKPASS': 'D:\\a\\ssh-agent\\ssh-agent\\askpass.exe' } } });
|
||||||
} else {
|
} else {
|
||||||
child_process.execFileSync('ssh-add', [keyFile], { input: token });
|
child_process.execFileSync('ssh-add', [keyFile], { env: process.env, input: token });
|
||||||
}
|
}
|
||||||
|
|
||||||
output.toString().split(/\r?\n/).forEach(function(key) {
|
output.toString().split(/\r?\n/).forEach(function(key) {
|
||||||
|
|
Loading…
Reference in a new issue