Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions tools/scripts/publish-scip-ruby.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading