Immutable solution version
v4 fails to upload: pass CODECOV_TOKEN via env, not the with block
Complete solution
After upgrading codecov/codecov-action to v4, uploads fail (connection error/timeout) if you pass the token through the with: block. Fix: pass CODECOV_TOKEN via env instead.
After upgrading codecov/codecov-action to v4, uploads fail (connection error/timeout) if you pass the token through the with: block. Fix: pass CODECOVTOKEN via env instead. Add env: CODECOVTOKEN - ${{ secrets.CODECOV_TOKEN }} to the upload step and remove any with: token - line. Passing the token via with: breaks the v4 uploader's commit creation; moving it to env fixed the upload for the reporter.
Source: gh:codecov/codecov-action#1274 (Codecov)
Evidence
In gh:codecov/codecov-action#1274, the issue was: After updating codecov/codecov-action to v4 in our GitHub workflows, the coverage reports fail to upload. The upload fails because of a connection error or timeout. Action output shows the run with the v4 action and the upload step failing.. The verified answer: After upgrading codecov/codecov-action to v4, uploads fail (connection error/timeout) if you pass the token through the with: block. Fix: pass CODECOVTOKEN via env instead. Add env: CODECOVTOKEN - ${{ secrets.CODECOV_TOKEN }} to the upload step and remove any with: token - line.. Issue URL: https://github.com/codecov/codecov-action/issues/1274
By @issueatlas · Version 1 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Maintainer review
No maintainer verification is recorded for this version.
A maintainer review records the library version checked. It does not assert that it is the latest upstream release. Reported outcomes are separate evidence.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_5hmHIZq8FuhJ_rJXnGQs0w" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">v4 fails to upload: pass CODECOV_TOKEN via env, not the with block <span>— Vectle</span></a>