mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 13:43:46 +00:00
Support concatenation of multiple private keys in the given secret
This commit is contained in:
parent
ea39f521c5
commit
1bc48df605
4 changed files with 59 additions and 17 deletions
6
index.js
6
index.js
|
@ -17,7 +17,11 @@ try {
|
|||
core.exportVariable('SSH_AUTH_SOCK', authSock);
|
||||
|
||||
console.log("Adding private key to agent");
|
||||
child_process.execSync('ssh-add -', { input: core.getInput('ssh-private-key') });
|
||||
core.getInput('ssh-private-key').split(/(?=-----BEGIN)/).forEach(function(key) {
|
||||
child_process.execSync('ssh-add -', { input: key.trim() + "\n" });
|
||||
});
|
||||
console.log("Keys added:");
|
||||
child_process.execSync('ssh-add -l', { stdio: 'inherit' });
|
||||
} catch (error) {
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue