Skip to content

fix(github): authenticate API calls to fix rate-limited star count showing 0#4891

Closed
fdelbrayelle wants to merge 1 commit into
mainfrom
fix/github-stars-rate-limit
Closed

fix(github): authenticate API calls to fix rate-limited star count showing 0#4891
fdelbrayelle wants to merge 1 commit into
mainfrom
fix/github-stars-rate-limit

Conversation

@fdelbrayelle
Copy link
Copy Markdown
Member

Summary

  • GitHub API calls were unauthenticated, capped at 60 req/hr per server IP — easily exhausted in production
  • On non-404 errors the handler logged but continued, potentially serving stale/zero data
  • Added optional GITHUB_TOKEN support via Astro's env schema to authenticate requests (raises limit to 5000/hr)
  • Fixed the error fallthrough: non-404 errors now return defaultValues immediately

Deployment step required

Add GITHUB_TOKEN as a secret env var in Cloudflare Pageskestra-io project → Settings → Environment variables.
Use the value of the existing GH_READ_ORG_TOKEN org secret.

Test plan

  • Add GITHUB_TOKEN to Cloudflare Pages env vars
  • Redeploy and confirm star count renders correctly on kestra.io homepage

🤖 Generated with Claude Code

…owing 0

Unauthenticated GitHub API calls are capped at 60 req/hr per IP — easily
exhausted in production. Add optional GITHUB_TOKEN support via Astro's env
schema to raise the limit to 5000/hr.

Also fix the error fallthrough: on non-404 errors the handler logged but
continued, risking stale/zero data; now returns defaultValues immediately.

Add GITHUB_TOKEN as a secret env var in Cloudflare Pages → kestra-io project
→ Settings → Environment variables. Use the value of GH_READ_ORG_TOKEN.
@fdelbrayelle
Copy link
Copy Markdown
Member Author

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

☁️ Cloudflare Worker Preview Deployed!

🔗 https://ks-fix-github-stars-rate-limit-docs.kestra-io.workers.dev
🔗 https://6c0530b3-docs.kestra-io.workers.dev

## 🔦 Lighthouse Benchmark

Tested: https://ks-fix-github-stars-rate-limit-docs.kestra-io.workers.dev on 2026-05-29 06:48 UTC
No baseline available — scores will appear after the first merge to main

Scores (0–100, higher is better)

Page Performance Accessibility Best Practices SEO
Home 92 83 56 92
Pricing 98 91 56 100
Enterprise 98 82 56 100
Cloud 90 87 56 100
About Us 86 91 56 100
Docs Landing 98 88 56 92
Contribute to Kestra (simple docs) 99 88 56 92
Flow (full featured docs) 98 90 56 92
Blog Index 74 91 56 100
Blog Post (sample) 92 87 56 100
VS Page (sample) 99 88 56 100
Plugins Landing 92 81 56 92
Plugin Page (sample) 95 87 56 100
Plugin Debug Page (sample) 95 87 56 100
Plugin Debug Return Page (sample) 93 88 59 100
Blueprints Landing 95 80 74 92
Blueprint Audit Logs CSV Export 68 86 56 100

Core Web Vitals (lower is better)

Page LCP FCP TBT CLS Speed Index
Home 1.34 s 0.73 s 106 ms 0.002 1.71 s
Pricing 0.97 s 0.60 s 0 ms 0.000 0.94 s
Enterprise 1.11 s 0.54 s 0 ms 0.000 0.89 s
Cloud 2.03 s 0.47 s 0 ms 0.000 0.93 s
About Us 2.53 s 0.58 s 0 ms 0.000 0.78 s
Docs Landing 0.84 s 0.56 s 93 ms 0.002 1.04 s
Contribute to Kestra (simple docs) 0.88 s 0.56 s 0 ms 0.000 0.85 s
Flow (full featured docs) 1.02 s 0.57 s 2 ms 0.000 1.21 s
Blog Index 3.91 s 1.10 s 2 ms 0.000 1.97 s
Blog Post (sample) 1.89 s 0.53 s 0 ms 0.000 0.94 s
VS Page (sample) 0.94 s 0.56 s 0 ms 0.000 0.73 s
Plugins Landing 0.93 s 0.55 s 2 ms 0.000 2.91 s
Plugin Page (sample) 0.96 s 0.55 s 3 ms 0.000 1.96 s
Plugin Debug Page (sample) 0.90 s 0.51 s 31 ms 0.001 1.99 s
Plugin Debug Return Page (sample) 1.11 s 0.52 s 3 ms 0.025 2.21 s
Blueprints Landing 1.06 s 0.58 s 0 ms 0.000 1.86 s
Blueprint Audit Logs CSV Export 1.70 s 0.57 s 12 ms 0.485 2.18 s
Legend

🟢 improved  ·  🔻 regressed  ·  (blank) no significant change
Score threshold: ±10 pts  ·  Metric threshold: ±30% of baseline

@MilosPaunovic MilosPaunovic deleted the fix/github-stars-rate-limit branch May 29, 2026 06:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant