mirror of
https://github.com/konpa/devicon.git
synced 2025-08-15 11:04:13 +02:00
add feature: svgo auto optimization to pull requests (#1554)
* 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>
This commit is contained in:
31
.github/scripts/svgo.config.js
vendored
Normal file
31
.github/scripts/svgo.config.js
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
module.exports = {
|
||||
plugins: [
|
||||
{
|
||||
name: 'preset-default'
|
||||
},
|
||||
{
|
||||
name: 'removeDimensions',
|
||||
params: {
|
||||
overrides: {
|
||||
removeDimensions: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'removeScriptElement',
|
||||
params: {
|
||||
overrides: {
|
||||
removeScriptElement: true,
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: "removeAttrs",
|
||||
params: {
|
||||
attrs: [
|
||||
'path:fill:none'
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
21
.github/workflows/optimize_icons.yml
vendored
Normal file
21
.github/workflows/optimize_icons.yml
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
name: Optimize icons
|
||||
on:
|
||||
- pull_request
|
||||
permissions: write-all
|
||||
|
||||
jobs:
|
||||
optimize:
|
||||
runs-on: ubuntu-latest
|
||||
name: Optimize icons with SVGO
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
|
||||
- uses: ericcornelissen/svgo-action@v3
|
||||
with:
|
||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
svgo-config: ./.github/scripts/svgo.config.js
|
||||
svgo-version: 3
|
||||
|
||||
- uses: stefanzweifel/git-auto-commit-action@v4
|
||||
with:
|
||||
commit_message: Icons optimized by SVGO
|
Reference in New Issue
Block a user