-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 feature: svgo auto optimization to pull requests #1554
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking forward to this feature, but it's not quite ready yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good as a starting point now. If this has been tested after the latest commit I'm okey with merging it in.
Good job @lunatic-fox ✔️
@lunatic-fox This needs to be merged to master for the script to work right? |
Actually no, it will work as soon as implemented like #1405. 😀 For instance, when the contributor makes a PR, the |
But doesn't the workflow get the config file from the default (master) branch? At least that's the default behaviour for executing scripts from a workflow file iirc |
As far as I tested, this new feature will work when merged to However, I found some issues when testing.
|
See #1624 for more information about this. |
As far as I got, the workflow files come from the branch that you're making the PR, that's why the #1332 works even when this feature is not implemented on The issue #1411 is some exception and it's more related to templates, not to workflows. 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise, this is looking great. Thanks! 🚀
Double check these details before you open a PR
Features
In
optimize_icons.yml
This workflow runs only on pull requests using SVGO action and git-auto-commit Action.
In
svgo.config.js
Converts
style
to inline attributes and removes dimensions, raster images and possible script elements.In
removeAttrs
we can add some unnecessary atributes to be removed. Currently it will remove:fill
stroke
andstroke
derived attributes likestroke-width
data
enable-background
xml:space
fill-rule
clip-rule
This PR closes #1547, #1549 and partially #1548
Notes