-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
only try and commit to git when there are changes (#1446)
- Loading branch information
Showing
1 changed file
with
9 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 |