mirror of
https://github.com/webfactory/ssh-agent.git
synced 2026-03-22 02:59:06 +08:00
Add an action input/flag to disable logging of public key information (#122)
This commit adds the new `log-public-key` action input. Closes #122 (contains the suggested changes plus a few tweaks and documentation), fixes #100. Co-authored-by: Matthias Pigulla <mp@webfactory.de>
This commit is contained in:
committed by
Matthias Pigulla
parent
28cb4d8505
commit
fbef2c7bd0
6
dist/index.js
vendored
6
dist/index.js
vendored
@@ -326,6 +326,7 @@ const { home, sshAgent, sshAdd } = __webpack_require__(972);
|
||||
|
||||
try {
|
||||
const privateKey = core.getInput('ssh-private-key');
|
||||
const logPublicKey = core.getBooleanInput('log-public-key', {default: true});
|
||||
|
||||
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.");
|
||||
@@ -374,8 +375,9 @@ try {
|
||||
const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i);
|
||||
|
||||
if (!parts) {
|
||||
console.log(`Comment for (public) key '${key}' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.`);
|
||||
|
||||
if (logPublicKey) {
|
||||
console.log(`Comment for (public) key '${key}' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.`);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user