[Breaking] Refactor ptable heatmap plotter #345
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: SVG Compression | |
on: | |
pull_request: | |
branches: [main] | |
paths: [assets/*.svg] # only run workflow when SVG files changed | |
jobs: | |
tests: | |
# don't run on PRs from forks | |
if: github.event.pull_request.head.repo.fork == false | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repo | |
uses: actions/checkout@v4 | |
with: | |
ref: ${{ github.head_ref }} | |
- name: Set up node | |
uses: actions/setup-node@v4 | |
- name: Install SVGO | |
run: npm install --global svgo | |
- name: Compress SVG assets and commit to current PR | |
run: | | |
svgo --multipass --final-newline assets --exclude ptable-scatters-*.svg | |
if git diff --quiet assets; then | |
echo "No changes to commit" | |
exit 0 | |
fi | |
git config user.name "Janosh Riebesell" | |
git config user.email [email protected] | |
git add assets | |
git commit -m "compress new SVG assets" | |
git push |