Schneegans / dynamic-badges-action

This action allows you to create badges for your README.md with shields.io which may change with every commit. To do this, this action does not need to push anything to your repository!
https://schneegans.github.io/tutorials/2022/04/18/badges
MIT License
257 stars 37 forks source link

Add save svg-badge directly to gist #25

Closed runarberg closed 1 year ago

runarberg commented 1 year ago

This adds the posibility of saving an SVG badge generated by the same shields.io dirictly to the gist. Instead of prepering a JSON file to be sent to their service, we use their library directly, which outputs an SVG file that we can save to the user’s gist.

Filenames ending in .svg will use this library automatically.

Additionally there is a major refactoring where the older node:http library has been swapped out for fetch.

Also swap from node 16 to node 20

fixes #24

Schneegans commented 1 year ago

Thanks a lot! This looks pretty good. I'll merge this into a temporary branch and do some thorough tests. Adding some decent CI tests would be a future task, I guess :eyes:

If everything works as supposed, I'll write some documentation for this new feature and then merge it to master!

Thank you very much!

LucBerge commented 1 year ago

What is the point of commiting node_modules/ ?

Thanks a lot! This looks pretty good. I'll merge this into a temporary branch and do some thorough tests. Adding some decent CI tests would be a future task, I guess 👀

I agree, would be nice to have a test workflow for future PRs to make sure nothing breaks.

runarberg commented 1 year ago

The github actions doc specify requests you commit node_modules:

From your terminal, commit your action.yml, index.js, node_modules, package.json, package-lock.json, and README.md files. If you added a .gitignore file that lists node_modules, you'll need to remove that line to commit the node_modules directory.

https://docs.github.com/en/actions/creating-actions/creating-a-javascript-action#commit-tag-and-push-your-action-to-github

I think there is a way to compile the node_modules directory into a single file with @versel/ncc however I think that is out of scope (and it certainly was for me :wink:)