diff --git a/dev/github-token.sh b/dev/github-token.sh index 8be07b2260e6e7..4672480b7123dd 100755 --- a/dev/github-token.sh +++ b/dev/github-token.sh @@ -8,11 +8,11 @@ if [ -z "$GH_TOKEN" ] && command -v git >/dev/null 2>&1; then # Attempt to get token from git credentials, suppress errors TOKEN=$(printf 'protocol=https\nhost=github.com\n' | git credential fill 2>/dev/null | awk -F= '/password/ {print $2}' 2>/dev/null) - + # Only export if we got a non-empty token if [ -n "$TOKEN" ]; then export GH_TOKEN="$TOKEN" fi - + unset TOKEN fi