Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.

Commit 724fada

Browse files
committed
Only ignore ssh agent with self-hosted
+ Private key and others could still be required for cloning
1 parent 2c295a5 commit 724fada

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

index.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,18 @@ void async function main() {
1313
}()
1414

1515
async function ssh() {
16-
if (core.getBooleanInput('self-hosted')) {
17-
return;
18-
}
19-
2016
let sshHomeDir = `${process.env['HOME']}/.ssh`
2117

2218
if (!fs.existsSync(sshHomeDir)) {
2319
fs.mkdirSync(sshHomeDir)
2420
}
2521

26-
let authSock = '/tmp/ssh-auth.sock'
27-
execa.sync('ssh-agent', ['-a', authSock])
28-
core.exportVariable('SSH_AUTH_SOCK', authSock)
22+
// If it is self-hosted we don't need to start the ssh agent
23+
if (!core.getBooleanInput('self-hosted')) {
24+
let authSock = '/tmp/ssh-auth.sock'
25+
execa.sync('ssh-agent', ['-a', authSock])
26+
core.exportVariable('SSH_AUTH_SOCK', authSock)
27+
}
2928

3029
let privateKey = core.getInput('private-key')
3130
if (privateKey !== '') {

0 commit comments

Comments
 (0)