Skip to content

Commit 51bb5c8

Browse files
ci: skip Code Coverage job when CODECOV_TOKEN isn't available
The Upload step in codecov.yml has `fail_ci_if_error: true`, so when the workflow runs on a fork (or anywhere else without `secrets.CODECOV_TOKEN`) the upload returns: Token required - not valid tokenless upload ==> Failed to create-commit …and the whole job goes red even though the test suite passed. Gate the entire job on `secrets.CODECOV_TOKEN != ''` so forks skip both the test run and the upload — running unit tests just to throw away the coverage report is wasted CI time. Anyone who actually wants the coverage can opt in by configuring the secret on their fork. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com> Signed-off-by: Arthur Schreiber <arthur@planetscale.com> (cherry picked from commit dea0555)
1 parent 248182c commit 51bb5c8

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

.github/workflows/codecov.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,11 @@ permissions: read-all
1616
jobs:
1717
test:
1818
name: Code Coverage
19+
# Skip the whole job when no CODECOV_TOKEN is available — without one the
20+
# final upload step fails ("Token required - not valid tokenless upload"),
21+
# so running the test suite just to throw the report away is wasted work.
22+
# Forks that want coverage can opt in by configuring CODECOV_TOKEN.
23+
if: ${{ secrets.CODECOV_TOKEN != '' }}
1924
runs-on: ${{ github.repository == 'vitessio/vitess' && 'gh-hosted-runners-16cores-1-24.04' || 'ubuntu-24.04' }}
2025

2126
steps:

0 commit comments

Comments
 (0)