codecov/codecov-action@v3 returns HTTP 429 rate limit errors during coverage upload in GitHub Actions, even when CODECOV_TOKEN is correctly set as a repository secret and referenced via token: ${{ secrets.CODECOV_TOKEN }}. The v3 action uses the deprecated bash uploader which does not properly authenticate with the token, causing tokenless-style rate limiting on public repos. With fail_ci_if_error: true, this fails the entire CI job despite all tests passing. The error message is: 'Rate limit reached. Please upload with the Codecov repository upload token to resolve issue.'
Upgrade from codecov/codecov-action@v3 to @v5 (or latest). The v3 action uses a deprecated bash uploader that does not properly pass the token to the Codecov API, resulting in tokenless rate limiting even when CODECOV_TOKEN is configured. The v5 action uses the new Codecov CLI which correctly authenticates uploads.
Also recommended:
actions/cache@v3 + ::set-output) with actions/setup-python@v5's built-in cache: pip — the manual approach breaks on Windows (PowerShell doesn't expand $GITHUB_OUTPUT the same way) and uses the deprecated ::set-output command.codecov.yml to configure project coverage thresholds:coverage:
status:
project:
default:
target: auto
threshold: 0.5%
patch:
default:
target: 100%This prevents the project coverage check from failing on measurement noise while still enforcing that all new/changed lines are covered.