From 7bf698404f78554e869e79fd6604b46719701708 Mon Sep 17 00:00:00 2001 From: Zac Spitzer Date: Wed, 10 Jul 2024 09:33:20 +0200 Subject: [PATCH] only try and commit to git when there are changes --- .github/workflows/index-recipes.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/index-recipes.yml b/.github/workflows/index-recipes.yml index c4369fba1..4242a44fa 100644 --- a/.github/workflows/index-recipes.yml +++ b/.github/workflows/index-recipes.yml @@ -33,7 +33,11 @@ jobs: run: | BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/}) git config --local user.email "action@github.com" - git config --local user.name "GitHub Action" - git add docs/recipes/index.json docs/recipes/README.md - git commit -m "Update recipes index and README" - git push origin $BRANCH_NAME + git config --local user.name "Lucee Docs GitHub Action" + if [ -n "$(git status --porcelain)" ]; + git add docs/recipes/index.json docs/recipes/README.md + git commit -m "Update recipes index and README" + git push origin $BRANCH_NAME + else + echo "No changes found" + fi