From ac584c67d4df373448a9f9cbfcbcecc82f09365d Mon Sep 17 00:00:00 2001 From: nimbleghost <132819643+nimbleghost@users.noreply.github.com> Date: Sun, 7 May 2023 17:20:02 +0200 Subject: [PATCH] =?UTF-8?q?ci:=20don=E2=80=99t=20commit=20css=20if=20nothi?= =?UTF-8?q?ng=20has=20changed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/tailwindcss.yml | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tailwindcss.yml b/.github/workflows/tailwindcss.yml index 94d160ebc..81390a3dc 100644 --- a/.github/workflows/tailwindcss.yml +++ b/.github/workflows/tailwindcss.yml @@ -9,17 +9,22 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Install dependencies working-directory: app/static - run: npm install + run: npm ci - name: Build CSS working-directory: app/static run: npx tailwindcss -o css/main.css --minify - name: Commit and push changes run: | - git config --global user.email "github-actions@github.com" - git config --global user.name "Github Actions" - git add app/static/ - git commit --allow-empty -m "Minifed CSS" - git push + git config --global user.email "actions@github.com" + git config --global user.name "GitHub Actions" + + if output="$(git status --porcelain)" && [ -z "$output" ]; then + echo "Nothing to commit." + else + git add app/static/ + git commit -m "Minifed CSS" + git push + fi