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: 503Common 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.infoConfirm the report exists; retry blips
- Ensure the test step actually wrote a coverage file at the path you reference.
- Set fail_ci_if_error thoughtfully so a transient 5xx does not block merges.
- 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
GitHub Actions peter-evans/create-pull-request 403 / Cannot Create PRFix peter-evans/create-pull-request failing to push or open a PR - missing pull-requests/contents write, or t…
GitHub Actions softprops/action-gh-release "Resource not accessible by integration"Fix softprops/action-gh-release failing to publish a release - missing contents: write permission, or a non-t…
GitHub Actions slackapi/slack-github-action Fails to PostFix slackapi/slack-github-action errors - a missing/invalid webhook URL or bot token, the wrong technique for…