mirror of
https://github.com/cpina/github-action-push-to-another-repository.git
synced 2024-12-22 08:06:10 -07:00
Avoid failing if no changes are to be pushed
This commit is contained in:
parent
61d842d233
commit
eae1cf2f70
|
@ -43,7 +43,9 @@ COMMIT_MESSAGE="${COMMIT_MESSAGE/ORIGIN_COMMIT/$ORIGIN_COMMIT}"
|
||||||
|
|
||||||
git add .
|
git add .
|
||||||
git status
|
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"
|
echo "Pushing git commit"
|
||||||
git push origin "$TARGET_BRANCH"
|
git push origin "$TARGET_BRANCH"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user