Skip to content

Commit

Permalink
fix(): #285 fix empty commit exit with error 🐛 (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreasAugustin authored Jan 3, 2023
1 parent 7a33121 commit 9925f84
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/sync_template.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ fi

if [ -s "${TEMPLATE_SYNC_IGNORE_FILE_PATH}" ]; then
echo "::group::restore ignore file"
info "restore the ignore file"
info "restore the ignore file"
git reset "${TEMPLATE_SYNC_IGNORE_FILE_PATH}"
git checkout -- "${TEMPLATE_SYNC_IGNORE_FILE_PATH}"
echo "::endgroup::"
Expand All @@ -98,6 +98,11 @@ if [ -s "${TEMPLATE_SYNC_IGNORE_FILE_PATH}" ]; then
git checkout -- .
fi

if git diff --quiet && git diff --staged --quiet; then
info "nothing to commit"
exit 0
fi

git commit -m "${PR_COMMIT_MSG}"

echo "::endgroup::"
Expand Down

0 comments on commit 9925f84

Please sign in to comment.