CircleCI coverage lambda
✓ Published0🌍 Public
ZZJONSSON
Last edited Jan 22, 2019
Created on Jan 22, 2019
This example shows a live coverage badge for a GitHub module, displaying the latest test coverage percentage as a green SVG shield. It retrieves recent build data from the CircleCI API, finds the most recent successful build, and fetches its coverage report artifact. The code extracts the percentage from the HTML report using a regex, then dynamically generates an SVG badge with embedded text and gradients. It relies on the `request` library with Bluebird promises, and the final output is served as an image/svg+xml response.
AI-generated description