Allow the user to override the commands for git
, ssh-agent
, and ssh-add
This commit is contained in:
parent
209e2d72ff
commit
1d64dd4577
5 changed files with 45 additions and 20 deletions
10
index.js
10
index.js
|
@ -2,12 +2,20 @@ const core = require('@actions/core');
|
|||
const child_process = require('child_process');
|
||||
const fs = require('fs');
|
||||
const crypto = require('crypto');
|
||||
const { homePath, sshAgentCmd, sshAddCmd, gitCmd } = require('./paths.js');
|
||||
const { homePath, sshAgentCmdDefault, sshAddCmdDefault, gitCmdDefault } = require('./paths.js');
|
||||
|
||||
try {
|
||||
const privateKey = core.getInput('ssh-private-key');
|
||||
const logPublicKey = core.getBooleanInput('log-public-key', {default: true});
|
||||
|
||||
const sshAgentCmdInput = core.getInput('ssh-agent-cmd');
|
||||
const sshAddCmdInput = core.getInput('ssh-add-cmd');
|
||||
const gitCmdInput = core.getInput('git-cmd');
|
||||
|
||||
const sshAgentCmd = sshAgentCmdInput ? sshAgentCmdInput : sshAgentCmdDefault
|
||||
const sshAddCmd = sshAddCmdInput ? sshAddCmdInput : sshAddCmdDefault
|
||||
const gitCmd = gitCmdInput ? gitCmdInput : gitCmdDefault
|
||||
|
||||
if (!privateKey) {
|
||||
core.setFailed("The ssh-private-key argument is empty. Maybe the secret has not been configured, or you are using a wrong secret name in your workflow file.");
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue