Skip to content

Instantly share code, notes, and snippets.

@dagood

dagood/doc.md Secret

Last active July 2, 2026 00:34
Show Gist options
  • Select an option

  • Save dagood/0532accee626f3c5219664da283f4c8c to your computer and use it in GitHub Desktop.

Select an option

Save dagood/0532accee626f3c5219664da283f4c8c to your computer and use it in GitHub Desktop.
On using raw.githubusercontent.com in automation

Should you depend on raw.githubusercontent.com for production or CI/CD?

Short answer: No. raw.githubusercontent.com is a convenience endpoint for viewing/fetching files interactively, not a supported content-delivery or distribution endpoint. GitHub itself now steers unauthenticated automated traffic away from it, and many large projects (including .NET) have migrated release metadata and install scripts to their own CDNs.

Main reasons to avoid it

  1. Rate limiting — the big one. As of GitHub's May 2025 changelog, unauthenticated requests to raw.githubusercontent.com (along with anonymous HTTPS clones and unauthenticated REST calls) are subject to tightened rate limits. Unauthenticated access is throttled aggressively (commonly cited around 60 requests/hour per IP), and GitHub explicitly recommends authenticating for "consistency and reliability." [1] [2] This is brutal for CI/CD, where many jobs share a small pool of egress IPs (e.g., cloud runners, corporate NAT) and collectively blow past the limit, causing intermittent, hard-to-diagnose failures.

  2. No SLA / not a supported CDN. GitHub provides no uptime or availability guarantee for the raw endpoint and has repeatedly stated it is not intended to be used as a CDN. Building critical infrastructure on top of it means unannounced changes or outages can break you with no recourse. [3]

  3. Secondary / abuse rate limits. Beyond the documented primary limits, GitHub applies undocumented abuse-detection throttling. Tripping it returns HTTP 429 and can result in temporary IP blocks (~30 minutes). These thresholds are intentionally opaque and adjusted dynamically, so you can't reliably engineer around them. [4] [5]

  4. Corporate firewall/proxy blocking. Many enterprise networks don't allowlist raw.githubusercontent.com because it's an open user-content host. Tools that depend on it fail outright in restricted environments. Microsoft-/vendor-owned domains (e.g., *.microsoft.com) are far more commonly allowlisted — a key driver behind .NET's move.

  5. Aggressive/opaque CDN caching (staleness). Content is served through Fastly with short cache-control TTLs, and updates can take time to propagate (users routinely report multi-minute staleness). You can't force cache invalidation except by using immutable commit-SHA URLs. Workflows that expect fresh content on every fetch can silently get stale data. [6]

  6. Content-Type: text/plain for everything. All files are served as text/plain regardless of actual type, which makes it unsuitable for serving JS/CSS/images/binaries as if it were a real static-asset CDN. [3]

What to do instead

  • Host critical artifacts/metadata on a real, owned CDN with an SLA (this is exactly what .NET did — moving to builds.dotnet.microsoft.com / Azure blob storage / dot.net).
  • If you must pull from GitHub, authenticate (PAT or GITHUB_TOKEN in Actions) to get the higher ~5,000 req/hour limit, and use the REST contents API (/repos/:owner/:repo/contents/:path) rather than raw URLs, since the API returns proper rate-limit headers. [1] [2]
  • Pin to immutable commit SHAs (not branch names) for any reproducibility, which also sidesteps the caching-staleness problem.
  • For public static web assets, use GitHub Pages or a purpose-built CDN rather than the raw endpoint. [6]

One-line version for a decision doc

raw.githubusercontent.com has no SLA, is not a supported CDN, throttles unauthenticated traffic hard (worsened by shared CI egress IPs), is frequently blocked by corporate firewalls, and can serve stale content — so critical build/install paths should use an owned CDN (or at minimum authenticated GitHub API access pinned to commit SHAs).


Key references

  1. Updated rate limits for unauthenticated requests — The GitHub Blog (May 8, 2025)
  2. Rate limits for the REST API — GitHub Docs
  3. Should GitHub Be Used as a CDN for JavaScript Libraries?
  4. GitHub rate limits for raw.githubusercontent.com (Stack Overflow, GitHub staff answer)
  5. GitHub Tightens Rate Limits for Unauthenticated Access — UndercodeNews
  6. Avoiding cached content from raw.githubusercontent.com (Stack Overflow)
  7. New GitHub Rate Limits for Anonymous Requests — OpenTofu #2802 (real-world project impact)

Two caveats on sourcing: A couple of these are community/third-party posts (items 3 and 5) rather than official GitHub documentation — I'd lean on references 1 and 2 (official GitHub sources) as the authoritative backbone for the rate-limit argument, and treat the others as corroborating real-world evidence. The exact numeric rate limit for the raw endpoint specifically isn't published by GitHub as a hard figure, so I'd phrase that as "heavily throttled" rather than citing a precise number in a formal doc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment