Skip to content

ci: migrate coverage badge from self-hosted SVG to Codecov - #137

Merged
knowledgecode merged 1 commit into
masterfrom
develop
Sep 6, 2026
Merged

ci: migrate coverage badge from self-hosted SVG to Codecov#137
knowledgecode merged 1 commit into
masterfrom
develop

Conversation

@knowledgecode

@knowledgecode knowledgecode commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Summary

  • The coverage job used to generate a badge SVG and git push it directly to master/develop with a contents: write token, which conflicts with the branch-protection policy that now requires PRs and disallows direct pushes to master.
  • Replaced the self-hosted badge generation/commit steps with codecov/codecov-action@v5, so coverage is uploaded to Codecov instead of being pushed back into the repo. The job's permission is reduced to contents: read.
  • Switched the vitest.config.ts coverage reporter from json-summary (only used for the old badge script) to lcov (auto-detected by Codecov).
  • Updated the README coverage badge to point at Codecov, and removed the now-unused .github/badges/coverage.svg.

Test plan

  • npm run test:coverage locally confirms coverage/lcov.info and coverage/index.html are generated
  • npm run lint passes
  • CODECOV_TOKEN repo secret is already configured; confirm the coverage job succeeds and uploads to Codecov after this merges
  • Confirm the README Coverage badge renders correctly after Codecov processes the first upload

The coverage job previously generated a badge SVG and pushed it
directly to master/develop with a contents:write token. Now that
master requires PRs and disallows direct pushes, that push no
longer fits the branch protection policy.

Upload coverage to Codecov instead, which serves the badge itself
and needs no git push, letting the job run with contents:read.
@codecov-commenter

Copy link
Copy Markdown

Welcome to Codecov 🎉

Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.

Thanks for integrating Codecov - We've got you covered ☂️

@knowledgecode
knowledgecode merged commit f864518 into master Sep 6, 2026
4 checks passed
@knowledgecode
knowledgecode deleted the develop branch September 6, 2026 00:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants