1
0
mirror of https://github.com/walkxcode/dashboard-icons.git synced 2025-03-21 03:50:23 +01:00
Bjorn Lammers d4e6031236
💚 Tries to fix git --diff error
Signed-off-by: Bjorn Lammers <walkxnl@gmail.com>
2023-04-16 23:36:26 +02:00

33 lines
924 B
YAML

name: 🗜️ SVG Compression
on:
push:
paths:
- '**/*.svg'
workflow_dispatch:
jobs:
compress-images:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Dependencies
run: |
sudo apt-get update
sudo npm install -g svgo
- name: Compress SVGs
run: |
echo "🎨 Compressing SVGs..."
git diff --name-only --diff-filter=d "${{ github.event.before }}..${{ github.event.after }}" | grep "\.svg$" | xargs -P 4 -I{} sh -c 'echo "Compressing {}"; svgo --quiet --multipass {}' || true
- name: Load to GitHub
run: |-
git config --global user.email "noreply@walkx.fyi"
git config --global user.name "Dashboard Icons Bot"
git add -A
git commit -m ":clamp: Compresses SVGs" || exit 0
git push