From 096bc6c3d4accbd0a7a77c1fda3dc62a9b639392 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20H=C3=B8xbro=20Hansen?= Date: Tue, 23 Apr 2024 11:06:51 +0200 Subject: [PATCH] Only optimize img if a png is added (#6780) --- .github/workflows/test.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml index 5f9cc7ca32..2036f0ce03 100644 --- a/.github/workflows/test.yaml +++ b/.github/workflows/test.yaml @@ -31,13 +31,16 @@ concurrency: jobs: pre_commit: name: Run pre-commit + needs: [setup] runs-on: 'ubuntu-latest' steps: - uses: holoviz-dev/holoviz_tasks/pre-commit@v0 - uses: pre-commit/action@v3.0.1 + if: needs.setup.outputs.img_change == 'true' with: extra_args: -a --hook-stage manual oxipng || true -- - uses: stefanzweifel/git-auto-commit-action@v4 + if: needs.setup.outputs.img_change == 'true' with: commit_message: "Optimize PNG images (lossless)" file_pattern: "*.png" @@ -49,6 +52,7 @@ jobs: outputs: code_change: ${{ steps.filter.outputs.code }} doc_change: ${{ steps.filter.outputs.doc }} + img_change: ${{ steps.filter.outputs.img }} matrix: ${{ env.MATRIX }} steps: - uses: actions/checkout@v4 @@ -70,6 +74,8 @@ jobs: - 'doc/how_to/**' - 'scripts/**' - 'lite/**' + img: + - '**/*.png' - name: Set matrix option run: | if [[ '${{ github.event_name }}' == 'workflow_dispatch' ]]; then