From 2a4b304b8316e290bf95d314395829413ffefe32 Mon Sep 17 00:00:00 2001 From: josedario87 Date: Sun, 12 Oct 2025 17:10:14 -0600 Subject: [PATCH] Fix: Load GITEA_TOKEN from bashrc in hook script --- .claude/hooks/monitor-gitea-action.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.claude/hooks/monitor-gitea-action.sh b/.claude/hooks/monitor-gitea-action.sh index b999c7c..866b6fb 100755 --- a/.claude/hooks/monitor-gitea-action.sh +++ b/.claude/hooks/monitor-gitea-action.sh @@ -9,7 +9,14 @@ set -euo pipefail GITEA_URL="https://gitea.nucleoriofrio.com" OWNER="nucleo000" REPO="plantillaNuxtAuthentikProxy" -GITEA_TOKEN="${GITEA_TOKEN:-}" # Debe estar en variable de entorno + +# Intentar cargar el token desde el entorno o desde ~/.bashrc +GITEA_TOKEN="${GITEA_TOKEN:-}" +if [ -z "$GITEA_TOKEN" ] && [ -f "$HOME/.bashrc" ]; then + # Intentar extraer el token de .bashrc + GITEA_TOKEN=$(grep -oP "export GITEA_TOKEN=['\"]?\K[^'\"]*" "$HOME/.bashrc" 2>/dev/null || echo "") +fi + MAX_WAIT_SECONDS=600 # 10 minutos POLL_INTERVAL=10 # Consultar cada 10 segundos