Avoid failing if no changes are to be pushed

This commit is contained in:
Carles Pina i Estany 2020-11-05 08:28:13 +00:00
parent 61d842d233
commit eae1cf2f70

View File

@ -43,7 +43,9 @@ COMMIT_MESSAGE="${COMMIT_MESSAGE/ORIGIN_COMMIT/$ORIGIN_COMMIT}"
git add .
git status
git commit --message "$COMMIT_MESSAGE"
# git diff-index : to avoid doing the git commit failing if there are no changes to be commit
git diff-index --quiet HEAD || git commit --message "$COMMIT_MESSAGE"
echo "Pushing git commit"
git push origin "$TARGET_BRANCH"