Skip to content

Commit

Permalink
opt-out rather than opt-in
Browse files Browse the repository at this point in the history
  • Loading branch information
camilo-celis committed Sep 2, 2022
1 parent 9683b6d commit f202749
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f202749

Please sign in to comment.