From 0a7dc1c09fbbc386f7a8adb41c325e5a077eb8d3 Mon Sep 17 00:00:00 2001 From: Matthias Pigulla Date: Wed, 19 Oct 2022 14:54:52 +0200 Subject: [PATCH] Avoid nonsensical log message (#139) This change avoids the `Comment for (public) key '' does not match GitHub URL pattern. Not treating it as a GitHub deploy key.` log message that was caused by inappropriate parsing of `ssh-add -L` output and confused a lot of users already. --- dist/index.js | 2 +- index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 20f7d61..3326288 100644 --- a/dist/index.js +++ b/dist/index.js @@ -371,7 +371,7 @@ try { console.log('Configuring deployment key(s)'); - child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) { + child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) { const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i); if (!parts) { diff --git a/index.js b/index.js index 0384fc4..add5f7c 100644 --- a/index.js +++ b/index.js @@ -51,7 +51,7 @@ try { console.log('Configuring deployment key(s)'); - child_process.execFileSync(sshAddCmd, ['-L']).toString().split(/\r?\n/).forEach(function(key) { + child_process.execFileSync(sshAddCmd, ['-L']).toString().trim().split(/\r?\n/).forEach(function(key) { const parts = key.match(/\bgithub\.com[:/]([_.a-z0-9-]+\/[_.a-z0-9-]+)/i); if (!parts) {