From 7663a81c1697508d4a3a846e772607d6113ea690 Mon Sep 17 00:00:00 2001 From: Yuriy Bakhtin Date: Mon, 16 Dec 2024 11:05:41 +0100 Subject: [PATCH] Skip creating of branch and PR if no changes from PHP CS Fixer (#7348) --- .github/workflows/php-cs-fixer.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/php-cs-fixer.yml b/.github/workflows/php-cs-fixer.yml index d33df70117..8d90609819 100644 --- a/.github/workflows/php-cs-fixer.yml +++ b/.github/workflows/php-cs-fixer.yml @@ -45,6 +45,10 @@ jobs: run: | git config user.name "GitHub Action" git config user.email "action@github.com" + if git diff --quiet; then + echo "No changes detected by PHP-CS-Fixer. Skipping commit and PR creation." + exit 0 + fi PHP_FIXER_DATETIME=$(date +%Y-%m-%d-%H%M%S) git checkout -b "php-fixer/$PHP_FIXER_DATETIME" git add -u