Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add save svg-badge directly to gist #25

Conversation

runarberg
Copy link
Contributor

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

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 Schneegans#24
@Schneegans
Copy link
Owner

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 👀

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

Thank you very much!

@Schneegans Schneegans changed the base branch from master to feature/save-svg October 5, 2023 17:46
@Schneegans Schneegans merged commit 1f41b12 into Schneegans:feature/save-svg Oct 5, 2023
@LucBerge
Copy link
Contributor

LucBerge commented Oct 6, 2023

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
Copy link
Contributor Author

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 😉)

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.

Write SVG files to gist
3 participants