feat: implement v2 with SVG badges and auto-commit functionality #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements v2 of the action, adding the ability to generate local SVG badge files and automatically commit them to the repository using the GitHub API. This addresses issues #23 and #24.
What's New in v2
🎨 Local SVG Badge Generation (Issue #23)
The action now uses the
badge-makerpackage to generate SVG badges locally instead of relying on shields.io URLs. This provides:badge_pathinputExample badge format:
🔄 Automated Commit & README Updates (Issue #24)
New optional features for automated workflow:
commit_badges: Automatically commit badge files to your repository using the GitHub REST APIupdate_readme: Automatically update your README.md with badge references<!-- start organization badges -->and<!-- end organization badges -->markerscommit_badges: trueSimplified workflow example:
No more manual bash scripts for committing and updating!
New Input Parameters
badge_pathbadgescommit_badgesfalsereadme_pathprofile/README.mdupdate_readmecommit_badges)falseTechnical Changes
Dependencies Added
badge-maker@4.0.0- SVG badge generation@octokit/rest@21.0.2- GitHub REST API operationsNew Functions
generateBadgeSVG()- Creates SVG badgessaveBadgeSVG()- Saves SVG files to diskgetFileContent()- Retrieves file content via GitHub APIcommitFile()- Creates/updates files via GitHub APIupdateReadmeWithBadges()- Updates README between markersTesting
Breaking Changes⚠️
This is a v2 release with breaking changes:
commit_badges: false) generates local files but doesn't commit themMigration Guide
v1 to v2 (maintaining shields.io URLs): Use v1
v2 with manual commits: Use v2 with
commit_badges: false(default)v2 with automation: Use v2 with
commit_badges: trueand optionallyupdate_readme: trueSee the updated README for detailed usage examples.
Closes
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
img.shields.ionode /home/REDACTED/work/organization-readme-badge-generator/organization-readme-badge-generator/node_modules/.bin/make-coverage-badge-better --label-color #333 --output-path ./badges/coverage.svg(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.