Skip to content

Commit 73bf998

Browse files
committed
ci: derive repo from gitverse remote in helper
1 parent 8a428e4 commit 73bf998

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

scripts/gitverse-ci.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,15 @@
1313
set -euo pipefail
1414

1515
API="https://api.gitverse.ru"
16-
REPO="${GITVERSE_REPO:-lavr/express-botx}"
16+
# repo: $GITVERSE_REPO, or derived from the "gitverse" git remote of the current repo
17+
REPO="${GITVERSE_REPO:-$(git remote get-url gitverse 2>/dev/null | sed -E 's|.*gitverse\.ru[:/]||; s|\.git$||' || true)}"
1718
TOKEN="${GITVERSE_TOKEN:-$(cat "$HOME/.gitverse_token" 2>/dev/null || true)}"
1819

20+
if [[ -z "$REPO" ]]; then
21+
echo "Error: set GITVERSE_REPO or run inside a repo with a 'gitverse' remote" >&2
22+
exit 1
23+
fi
24+
1925
if [[ -z "$TOKEN" ]]; then
2026
echo "Error: set GITVERSE_TOKEN or put token into ~/.gitverse_token" >&2
2127
exit 1

0 commit comments

Comments
 (0)