From f202749619015f7e3709bd6646523dc5b14774fc Mon Sep 17 00:00:00 2001 From: Camilo Celis Guzman Date: Fri, 2 Sep 2022 15:30:25 +0900 Subject: [PATCH] opt-out rather than opt-in --- action.yml | 5 +++-- index.js | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/action.yml b/action.yml index 85e8943..838515a 100644 --- a/action.yml +++ b/action.yml @@ -6,9 +6,10 @@ inputs: required: true ssh-auth-sock: description: 'Where to place the SSH Agent auth socket' - log-public-key: + dont-log-public-key: description: 'Whether or not to log public key fingerprints' - default: true + required: false + default: false runs: using: 'node12' main: 'dist/index.js' diff --git a/index.js b/index.js index fdef02d..c8ad8aa 100644 --- a/index.js +++ b/index.js @@ -6,7 +6,7 @@ const { home, sshAgent, sshAdd } = require('./paths.js'); try { const privateKey = core.getInput('ssh-private-key'); - const logPublicKey = core.getBooleanInput('log-public-key'); + const dontLogPublicKey = core.getBooleanInput('dont-log-public-key', {default: false}); 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."); @@ -55,7 +55,7 @@ try { const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i); if (!parts) { - if (logPublicKey) { + if (!dontLogPublicKey) { console.log(`Comment for (public) key '${key}' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.`); } return;