From 6e1157134ce67b44514db507d59ea43896d5db08 Mon Sep 17 00:00:00 2001 From: Aleksey Sabilin Date: Tue, 7 Jul 2026 17:17:33 +0300 Subject: [PATCH] Fix git-push URL and BOM-safe secrets loading --- scripts/git-push.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 scripts/git-push.sh diff --git a/scripts/git-push.sh b/scripts/git-push.sh new file mode 100644 index 0000000..6355872 --- /dev/null +++ b/scripts/git-push.sh @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Push master to origin using Gitea token from secrets (no token in shell command line). +set -euo pipefail + +SECRETS="/mnt/c/Users/alexc/.cursor/secrets/eventhub-gitea.env" +if [ ! -f "$SECRETS" ]; then + echo "Missing $SECRETS — run eventhub-gitea setup-env.ps1" >&2 + exit 1 +fi + +set -a +# shellcheck disable=SC1090 +source <(sed $'s/\xEF\xBB\xBF//' "$SECRETS" | tr -d '\r') +set +a + +: "${GITEA_TOKEN:?GITEA_TOKEN not set}" +: "${GITEA_USER:=cursor-ai}" + +REPO_ROOT=$(cd "$(dirname "$0")/.." && pwd) +REMOTE_NAME=$(basename "$REPO_ROOT") +PUSH_URL="https://${GITEA_USER}:${GITEA_TOKEN}@git.sabilin.com/EventHub/${REMOTE_NAME}.git" + +cd "$REPO_ROOT" +git push "$PUSH_URL" master +echo "Pushed EventHub/${REMOTE_NAME} master"