Skip to content

Authenticate GitHub API requests in CI workflows to avoid rate limiting#830

Merged
stevevanhooser merged 2 commits into
mainfrom
claude/matlab-ci-github-rate-limit-tg1srt
Jun 29, 2026
Merged

Authenticate GitHub API requests in CI workflows to avoid rate limiting#830
stevevanhooser merged 2 commits into
mainfrom
claude/matlab-ci-github-rate-limit-tg1srt

Conversation

@stevevanhooser

Copy link
Copy Markdown
Contributor

Summary

Added GitHub token authentication to CI workflows to prevent unauthenticated rate limiting errors during dependency resolution.

Changes

  • test-cloud-api.yml: Added GITHUB_TOKEN environment variable at the job level to authenticate MatBox dependency resolution calls to the GitHub API
  • deploy-docs.yml: Added GITHUB_TOKEN environment variable at the job level for the same purpose

Details

MatBox dependency resolution makes calls to the GitHub API during the install requirements step. Without authentication, these requests are subject to GitHub's unauthenticated rate limits, which can result in 429 "Too Many Requests" errors from api.github.com. By setting the GITHUB_TOKEN environment variable at the job level (using secrets.GITHUB_TOKEN), both the MatBox installation step and any subsequent authenticated requests benefit from the higher authenticated rate limits, preventing transient CI failures due to rate limiting.

https://claude.ai/code/session_01GKuJhj4vynfKihfSo7Fgc7

claude added 2 commits June 29, 2026 11:38
test-cloud-api.yml and deploy-docs.yml run matbox.installRequirements,
which resolves git dependencies via the GitHub API. Without a token these
requests are unauthenticated and share the runner IP's 60 req/hr limit,
surfacing as a 429 "Too Many Requests" from api.github.com (seen fetching
the vhlab-toolbox-matlab commit hash).

Set GITHUB_TOKEN at the job level, matching run-tests.yml, test-symmetry.yml,
and test-cloud-prod.yml. Job-level env authenticates the Install MatBox step
too, not just the in-MATLAB setenv, so every GitHub API call in the job uses
the authenticated 5000 req/hr limit.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKuJhj4vynfKihfSo7Fgc7
…429)

The job-level GITHUB_TOKEN raises the primary GitHub API rate limit, but CI
still fails with HTTP 429 "Too Many Requests" when matbox resolves git
dependencies. A 429 is GitHub's *secondary* rate limit (burst/abuse
detection), which authentication does not prevent; it clears on its own
within a minute.

Add nditools.installRequirements, a thin wrapper around
matbox.installRequirements that retries with exponential backoff (15/30/60/120s)
on 429 and transient network errors, and route the test task entry points
(testCloudApi, testCloudApiPart, testToolboxNoCloud, testToolbox) and the
symmetry workflow through it.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GKuJhj4vynfKihfSo7Fgc7
@github-actions

Copy link
Copy Markdown
Contributor

Test Results

600 tests  ±0   599 ✅ ±0   4m 52s ⏱️ -11s
111 suites ±0     1 💤 ±0 
  1 files   ±0     0 ❌ ±0 

Results for commit 669085a. ± Comparison against base commit 4b0b5f3.

@codecov

codecov Bot commented Jun 29, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 23.83%. Comparing base (4b0b5f3) to head (669085a).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #830   +/-   ##
=======================================
  Coverage   23.83%   23.83%           
=======================================
  Files         695      695           
  Lines       31016    31016           
=======================================
  Hits         7393     7393           
  Misses      23623    23623           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@stevevanhooser stevevanhooser merged commit cb34982 into main Jun 29, 2026
15 of 16 checks passed
@stevevanhooser stevevanhooser deleted the claude/matlab-ci-github-rate-limit-tg1srt branch June 29, 2026 12:34
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.

3 participants