Skip to content

Commit

Permalink
only try and commit to git when there are changes (#1446)
Browse files Browse the repository at this point in the history
  • Loading branch information
zspitzer authored Jul 10, 2024
1 parent 809d759 commit c080e9f
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions .github/workflows/index-recipes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,12 @@ jobs:
- name: Commit and push changes
run: |
BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})
git config --local user.email "[email protected]"
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
if [ -n "$(git status --porcelain)" ]; then
git config --local user.email "[email protected]"
git config --local user.name "Lucee Docs 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
else
echo "No changes found to commit"
fi

0 comments on commit c080e9f

Please sign in to comment.