From 5b06abfe4eb323864e9a1ddad86b0029a8e170b0 Mon Sep 17 00:00:00 2001 From: Alexander Whitestone Date: Wed, 15 Apr 2026 03:15:55 +0000 Subject: [PATCH] fix: Load GitHub token from ~/.config/github/token (closes #74) --- scripts/run_upstream_watch.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scripts/run_upstream_watch.sh b/scripts/run_upstream_watch.sh index 216a0663..674dde91 100755 --- a/scripts/run_upstream_watch.sh +++ b/scripts/run_upstream_watch.sh @@ -9,10 +9,15 @@ DAYS=${1:-30} echo "Running TurboQuant upstream watch for last $DAYS days..." -# Check if GitHub token is set +# Check if GitHub token is set (env var or ~/.config/github/token file) +if [ -z "$GITHUB_TOKEN" ] && [ -f "$HOME/.config/github/token" ]; then + export GITHUB_TOKEN=$(cat "$HOME/.config/github/token" | tr -d '[:space:]') + echo "Loaded GitHub token from ~/.config/github/token" +fi + if [ -z "$GITHUB_TOKEN" ]; then echo "Warning: GITHUB_TOKEN not set. Using unauthenticated API (60 req/hour limit)." - echo "Set GITHUB_TOKEN for higher rate limits." + echo "Set GITHUB_TOKEN or create ~/.config/github/token for higher rate limits." echo "" fi