mirror of
https://github.com/webfactory/ssh-agent.git
synced 2025-06-28 05:33:45 +00:00
Support multiple SSH keys (#14)
* Support concatenation of multiple private keys in the given secret * Add a changelog
This commit is contained in:
parent
ea39f521c5
commit
6cf6299d23
5 changed files with 73 additions and 17 deletions
6
dist/index.js
vendored
6
dist/index.js
vendored
|
@ -72,7 +72,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