-
Notifications
You must be signed in to change notification settings - Fork 8.1k
Fix GitHub API rate limit errors in test actions #26489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Add GITHUB_TOKEN input to nix and windows test actions - Use Authorization header with Bearer token in all Invoke-RestMethod calls - Pass GITHUB_TOKEN from workflows to test actions - Fixes GitHub API rate limit errors by using authenticated requests Co-authored-by: TravisEz13 <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR addresses GitHub API rate limit errors in test actions by adding authentication to API calls. Unauthenticated requests to the GitHub API are limited to 60 requests per hour, which CI jobs were exceeding when fetching DSC releases. By authenticating with the built-in GITHUB_TOKEN, the rate limit increases to 5,000 requests per hour.
Key changes:
- Added
GITHUB_TOKENinput parameter to test actions with Bearer authentication headers - Updated all
Invoke-RestMethodcalls to include the Authorization header - Passed
secrets.GITHUB_TOKENto test actions in 12 job invocations across Linux, macOS, and Windows CI workflows
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
.github/actions/test/windows/action.yml |
Added GITHUB_TOKEN input and Authorization header to both GitHub API calls (releases and asset download) |
.github/actions/test/nix/action.yml |
Added GITHUB_TOKEN input and Authorization header to both GitHub API calls (releases and asset download) |
.github/workflows/windows-ci.yml |
Passed GITHUB_TOKEN to 4 test job invocations (unelevated/elevated × CI/Others) |
.github/workflows/macos-ci.yml |
Passed GITHUB_TOKEN to 4 test job invocations (unelevated/elevated × CI/Others) |
.github/workflows/linux-ci.yml |
Passed GITHUB_TOKEN to 4 test job invocations (unelevated/elevated × CI/Others) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: TravisEz13 <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: TravisEz13 <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: TravisEz13 <[email protected]>
PR Summary
Test actions were hitting GitHub API rate limits (60 req/hr unauthenticated) when fetching DSC releases, causing CI failures:
Changes
Added
GITHUB_TOKENauthentication to API calls in test actions:Test actions (
.github/actions/test/{nix,windows}/action.yml)GITHUB_TOKENinput parameterInvoke-RestMethodcallsWorkflows (
.github/workflows/{linux,macos,windows}-ci.yml)${{ secrets.GITHUB_TOKEN }}to test actions (12 job invocations)Authenticated requests have 5000 req/hr limit vs 60 unauthenticated.
PR Context
CI jobs intermittently fail when multiple test runs execute concurrently, exhausting the unauthenticated rate limit. Uses built-in
GITHUB_TOKEN, no new secrets required.PR Checklist
.h,.cpp,.cs,.ps1and.psm1files have the correct copyright headerWarning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
https://api.github.com/rate_limitpwsh /tmp/test_api_auth.ps1(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.