diff --git a/action.yml b/action.yml index 16aaba6..85e8943 100644 --- a/action.yml +++ b/action.yml @@ -6,6 +6,9 @@ inputs: required: true ssh-auth-sock: description: 'Where to place the SSH Agent auth socket' + log-public-key: + description: 'Whether or not to log public key fingerprints' + default: true runs: using: 'node12' main: 'dist/index.js' diff --git a/index.js b/index.js index 91d0514..fdef02d 100644 --- a/index.js +++ b/index.js @@ -4,25 +4,9 @@ const fs = require('fs'); const crypto = require('crypto'); const { home, sshAgent, sshAdd } = require('./paths.js'); -// FIXME: slightly modified version of never version of core.getBooleanInput -// as that doesn't respect required:false -core.getBooleanInput = function getBooleanInput(name, options) { - const trueValue = ['true', 'True', 'TRUE'] - const falseValue = ['false', 'False', 'FALSE'] - const val = core.getInput(name, options) - if (!val) return false // replace with default InputOption - if (trueValue.includes(val)) return true - if (falseValue.includes(val)) return false - throw new TypeError( - `Input does not meet YAML 1.2 "Core Schema" specification: ${name}\n` + - `Support boolean input list: \`true | True | TRUE | false | False | FALSE\`` - ) -} - - try { const privateKey = core.getInput('ssh-private-key'); - const logPublicKey = core.getBooleanInput('log-public-key', {required: false}); + const logPublicKey = core.getBooleanInput('log-public-key'); 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.");