Fix: Load GITEA_TOKEN from bashrc in hook script

This commit is contained in:
2025-10-12 17:10:14 -06:00
parent c794a883fa
commit 2a4b304b83

View File

@@ -9,7 +9,14 @@ set -euo pipefail
GITEA_URL="https://gitea.nucleoriofrio.com" GITEA_URL="https://gitea.nucleoriofrio.com"
OWNER="nucleo000" OWNER="nucleo000"
REPO="plantillaNuxtAuthentikProxy" 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 MAX_WAIT_SECONDS=600 # 10 minutos
POLL_INTERVAL=10 # Consultar cada 10 segundos POLL_INTERVAL=10 # Consultar cada 10 segundos