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