Skip to content

feat: surface shareable report badge after Pages deploy - #9

Merged
shenxianpeng merged 3 commits into
mainfrom
claude/gitstatus-share-badge-g3hdul
Aug 27, 2026
Merged

shenxianpeng merged 3 commits into
mainfrom
claude/gitstatus-share-badge-g3hdul

Conversation

@shenxianpeng

@shenxianpeng shenxianpeng commented Aug 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

gitstats now writes a badge set into every report, deployed alongside index.html (see companion PR shenxianpeng/gitstats#272): a default badge.svg plus badges/<metric>.svg for every metric (commits, last-commit, authors, files, lines) and badges/<metric>.json in the shields.io endpoint schema. This PR makes the badges easy to adopt from the action:

  • New outputs: badge_url and badge_markdown

  • The deploy step writes ready-to-copy badge markdown (with a live preview) to the job summary, so after one workflow run users can paste this straight into their README:

    [[GitStats](https://<owner>.github.io/<repo>/badge.svg)](https://<owner>.github.io/<repo>/)
  • The summary also points at the metric variants (badges/<metric>.svg) and config-based styling

  • README: new "Add a badge to your README" section with customization docs (metric URLs, badge_metric/badge_label/badge_color/badge_style via the config input, and the img.shields.io/endpoint route for full URL-parameter customization), outputs table rows, and a "What's Included" bullet

Notes

  • The badges are generated by gitstats, so action-deployed reports pick them up once the next gitstats release is on PyPI; until then the summary block still renders and the badge URL becomes live on the first deploy with the new version.
  • action.yml YAML and the shell snippets were validated locally.

🤖 Generated with Claude Code

https://claude.ai/code/session_01EXwAqUQfggpAAtSeHPQQxy

shenxianpeng and others added 2 commits August 27, 2026 06:41
gitstats now writes a badge.svg (live commit count, brand colors) into
every report, deployed alongside index.html. Make it easy to adopt:

- new outputs: badge_url and badge_markdown
- the deploy step writes ready-to-copy badge markdown (with a live
  preview) to the job summary, so users can paste
  [![GitStats](<pages>/badge.svg)](<pages>/) straight into their README
- document the badge in the README (new section, outputs table,
  what's-included list)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXwAqUQfggpAAtSeHPQQxy
…point

gitstats now pre-renders badges/<metric>.svg (commits, last-commit,
authors, files, lines) and badges/<metric>.json (shields endpoint
schema) alongside badge.svg. Surface that:

- job summary mentions the metric variants and config-based styling
- README documents metric URLs, the config input keys
  (badge_metric/badge_label/badge_color/badge_style), and the
  img.shields.io/endpoint route for full URL-parameter customization

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EXwAqUQfggpAAtSeHPQQxy
@shenxianpeng shenxianpeng added the enhancement New feature or request label Aug 27, 2026
@shenxianpeng
shenxianpeng merged commit 146ee68 into main Aug 27, 2026
4 checks passed
@shenxianpeng
shenxianpeng deleted the claude/gitstatus-share-badge-g3hdul branch August 27, 2026 08:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant