Skip to content
Latchkey

GitHub Actions codecov/codecov-action "Token required" / Upload Rejected

codecov/codecov-action could not upload coverage. Private repos require a token, the coverage file may be missing, or the upload endpoint had a transient error.

What this error means

The codecov step fails saying a token is required, that no coverage reports were found, or with a transient upload error. Coverage does not appear on Codecov for the run.

Actions log
Error: Codecov token not found. Please provide a token via the token input.
# or
['error'] There was an error fetching the storage URL during upload: 503

Common causes

Missing token on a private repo

Tokenless upload works for some public repos, but private repos require CODECOV_TOKEN passed to the action, or the upload is rejected.

No coverage file or transient endpoint error

If the test step did not produce a coverage report at the expected path, there is nothing to upload; separately, the upload endpoint can fail transiently with a 5xx.

How to fix it

Pass the token and point at the report

.github/workflows/ci.yml
- uses: codecov/codecov-action@v4
  with:
    token: ${{ secrets.CODECOV_TOKEN }}
    files: ./coverage/lcov.info

Confirm the report exists; retry blips

  1. Ensure the test step actually wrote a coverage file at the path you reference.
  2. Set fail_ci_if_error thoughtfully so a transient 5xx does not block merges.
  3. Re-run when the failure is an upload-endpoint 5xx rather than a missing token.

How to prevent it

  • Provide CODECOV_TOKEN for private repositories.
  • Verify the coverage report path before uploading.
  • Treat upload-endpoint 5xx errors as retryable.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →