From d324a05f260da275e42f6aff9a628059364b06cd Mon Sep 17 00:00:00 2001 From: Emi Date: Thu, 3 Sep 2026 12:04:05 -0700 Subject: [PATCH] fix: make publish script allow Git/SSH origin URLs `publish-scip-ruby.sh` rejected anything except HTTPS clone URLs, make it support SSH. Signed-off-by: Emi --- tools/scripts/publish-scip-ruby.sh | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/scripts/publish-scip-ruby.sh b/tools/scripts/publish-scip-ruby.sh index ccf91757a..93fdc0ca9 100755 --- a/tools/scripts/publish-scip-ruby.sh +++ b/tools/scripts/publish-scip-ruby.sh @@ -31,10 +31,15 @@ if ! git diff --quiet --cached; then exit 1 fi -if ! git remote -v | grep "origin" | grep -q "https://github.com/sourcegraph/scip-ruby.git"; then - echo "error: remote 'origin' doesn't point to sourcegraph/scip-ruby" - exit 1 -fi +ORIGIN_PUSH_URL="$(git remote get-url --push origin 2>/dev/null || true)" +case "$ORIGIN_PUSH_URL" in + https://github.com/sourcegraph/scip-ruby.git|git@github.com:sourcegraph/scip-ruby.git) + ;; + *) + echo "error: remote 'origin' doesn't point to sourcegraph/scip-ruby" + exit 1 + ;; +esac if ! git rev-parse --abbrev-ref HEAD | grep -q "scip-ruby/master"; then echo "error: Releases should be published from scip-ruby/master but HEAD is on a different branch" >&2