From 6d9ae46a015090b4049e282b6804899a4c3374a8 Mon Sep 17 00:00:00 2001 From: RafaelGSS Date: Mon, 11 Mar 2024 18:10:50 -0300 Subject: [PATCH] fix: handle when remote is ssh --- lib/prepare_security.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/prepare_security.js b/lib/prepare_security.js index 608a797c..bd258dbc 100644 --- a/lib/prepare_security.js +++ b/lib/prepare_security.js @@ -104,9 +104,12 @@ class PrepareSecurityRelease { checkRemote(cli) { const remote = runSync('git', ['ls-remote', '--get-url', 'origin']).trim(); const { owner, repo } = this.repository; - const securityReleaseOrigin = `https://github.com/${owner}/${repo}.git`; + const securityReleaseOrigin = [ + `https://github.com/${owner}/${repo}.git`, + `git@github.com:${owner}/${repo}.git` + ]; - if (remote !== securityReleaseOrigin) { + if (!securityReleaseOrigin.includes(remote)) { cli.error(`Wrong repository! It should be ${securityReleaseOrigin}`); process.exit(1); }