-
Notifications
You must be signed in to change notification settings - Fork 2.4k
add feature: svgo auto optimization to pull requests #1554
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
Conversation
Snailedlt
left a comment
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
Snailedlt
left a comment
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. 😅 |
Panquesito7
left a comment
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! 🚀
* Add a workflow to SVGO Optimizer * update `svgo.config.js` * Update optimize_icons.yml --------- Co-authored-by: Jørgen Kalsnes Hagen <43886029+Snailedlt@users.noreply.github.com> Co-authored-by: David Leal <halfpacho@gmail.com>
Double check these details before you open a PR
Features
In
optimize_icons.ymlThis workflow runs only on pull requests using SVGO action and git-auto-commit Action.
In
svgo.config.jsConverts
styleto inline attributes and removes dimensions, raster images and possible script elements.In
removeAttrswe can add some unnecessary atributes to be removed. Currently it will remove:fillstrokeandstrokederived attributes likestroke-widthdataenable-backgroundxml:spacefill-ruleclip-ruleThis PR closes #1547, #1549 and partially #1548
Notes