Skip to content

Commit 9ca13ff

Browse files
fix: authenticate GitHub API call in deploy-docs workflow (#29)
Unauthenticated requests to api.github.com/repos/.../releases/latest hit the 60 req/hr rate limit, returning an empty 403 body that caused json.load() to raise JSONDecodeError. Fix by: - Injecting GITHUB_TOKEN as Bearer auth header (rate limit → 5000/hr) - Capturing the API response to $RELEASE_JSON before piping to python3 so a failed curl exits non-zero via set -euo pipefail instead of silently feeding empty stdin to json.load()
1 parent eda42b4 commit 9ca13ff

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

.github/workflows/deploy-docs.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,16 @@ jobs:
5959
run: uv sync --group dev
6060

6161
- name: Download Lucide Icons
62+
env:
63+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6264
run: |
65+
set -euo pipefail
6366
mkdir -p overrides/.icons/lucide
64-
ASSET_URL=$(curl -sf https://api.github.com/repos/lucide-icons/lucide/releases/latest \
67+
RELEASE_JSON=$(curl -sf \
68+
-H "Authorization: Bearer $GH_TOKEN" \
69+
-H "Accept: application/vnd.github+json" \
70+
https://api.github.com/repos/lucide-icons/lucide/releases/latest)
71+
ASSET_URL=$(echo "$RELEASE_JSON" \
6572
| python3 -c "import sys,json; r=json.load(sys.stdin); print(next(a['browser_download_url'] for a in r['assets'] if a['name'].startswith('lucide-icons') and a['name'].endswith('.zip')))")
6673
curl -sL "$ASSET_URL" -o /tmp/lucide.zip
6774
unzip -q /tmp/lucide.zip "*.svg" -d /tmp/lucide-extracted

0 commit comments

Comments
 (0)