Fix push create release commits on ci

This commit is contained in:
Filipe PINTO 2023-02-01 16:11:27 +01:00 committed by GitHub
parent 7879344f26
commit fd71cb357e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,13 +270,18 @@ jobs:
- name: Push create release commits - name: Push create release commits
run: | run: |
git commit -am "Create ${{ needs.set-context.outputs.release_version }} release" git diff --exit-code && diff=false || diff=true
git push && git_exit_code=0 || git_exit_code=$? if [ "${diff}" == "true" ] ; then
if [ ${git_exit_code} -eq 0 ] ; then git commit -am "Create ${{ needs.set-context.outputs.release_version }} release"
echo " - ✅ commits pushed to ${{ needs.set-context.outputs.release_branch }}." git push && git_exit_code=0 || git_exit_code=$?
if [ ${git_exit_code} -eq 0 ] ; then
echo " - ✅ commits pushed to ${{ needs.set-context.outputs.release_branch }}."
else
echo " - ❌ A problem occurs when attempting to push create relase commits to ${{ needs.set-context.outputs.release_branch }} branch."
exit 1
fi
else else
echo " - ❌ A problem occurs when attempting to push create relase commits to ${{ needs.set-context.outputs.release_branch }} branch." echo " - ✅ no changes"
exit 1
fi fi
- name: Archive artifacts - name: Archive artifacts