Skip to content

feat: add dynamic code coverage badge#87

Merged
github-actions[bot] merged 4 commits into
mainfrom
dynamic-coverage-badge
Jun 6, 2026
Merged

feat: add dynamic code coverage badge#87
github-actions[bot] merged 4 commits into
mainfrom
dynamic-coverage-badge

Conversation

@SebTardif
Copy link
Copy Markdown
Contributor

Summary

Add a dynamic code coverage badge to the README that auto-updates on every push to main.

How it works

  1. The unit-test CI job already runs npm run test:coverage on ubuntu-latest
  2. New steps extract the line coverage percentage from the test output
  3. On pushes to main, schneegans/dynamic-badges-action updates a shields.io endpoint JSON in a GitHub Gist
  4. The README badge reads from that Gist endpoint

Same pattern used by patchloom/patchloom.

Setup required

Set the GIST_TOKEN repo secret (classic PAT with gist scope, same token used in patchloom/patchloom). Without it, the badge update step is skipped (continue-on-error: true).

Changes

  • .github/workflows/ci.yml: Extract coverage percentage, determine badge color, update Gist on main pushes
  • README.md: Add coverage badge between Security and VS Code Marketplace badges

Current coverage: 82% line coverage across 206 tests.

Extract line coverage percentage from npm run test:coverage output
and update a shields.io endpoint badge via GitHub Gist on pushes
to main. Uses schneegans/dynamic-badges-action with continue-on-error
so CI is not blocked if GIST_TOKEN is not set.

Badge added to README.md between Security and VS Code Marketplace badges.

Gist: d01e4551b744b77e2927555e43a4b935
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Jun 5, 2026
@github-actions github-actions Bot enabled auto-merge (squash) June 5, 2026 23:41
Badge SVG endpoints are prone to transient 500 errors that cause
false positive link checker failures.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
github-actions[bot]
github-actions Bot previously approved these changes Jun 5, 2026
SebTardif and others added 2 commits June 5, 2026 17:28
When a PR merges, the post-merge workflow now iterates all open PRs
and runs gh pr update-branch on each. This eliminates the manual
'Update branch' click when strict status checks require branches
to be up to date.

Also enabled allow_update_branch on the repo via API.

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
@github-actions github-actions Bot merged commit 73c7231 into main Jun 6, 2026
20 checks passed
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.

1 participant