From 46e929e4c6539bd604539ba27d5ed0c606e87bb9 Mon Sep 17 00:00:00 2001 From: Jon Chery Date: Wed, 3 Jun 2026 12:34:55 +0000 Subject: [PATCH] chore(P01): source .env in trigger_coreci.sh for GITEA_TOKEN ---ci--- project: orca phase: 1 milestone: v0.1 status: ship ---/ci--- --- scripts/trigger_coreci.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/scripts/trigger_coreci.sh b/scripts/trigger_coreci.sh index 4eb7094..758cf25 100755 --- a/scripts/trigger_coreci.sh +++ b/scripts/trigger_coreci.sh @@ -5,6 +5,20 @@ set -uo pipefail +# Source .env if present (provides GITEA_TOKEN) +# Look in repo root, then cwd, then script dir +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +REPO_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)" +for env_file in "$REPO_ROOT/.env" "$PWD/.env" "./.env"; do + if [ -f "$env_file" ]; then + set -a + # shellcheck disable=SC1090 + . "$env_file" + set +a + break + fi +done + CORECI_URL="${CORECI_URL:-https://git.cloudinit.dev/coreci/coreci}" GITEA_TOKEN="${GITEA_TOKEN:-}"