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
run: |
git commit -am "Create ${{ needs.set-context.outputs.release_version }} release"
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 }}."
git diff --exit-code && diff=false || diff=true
if [ "${diff}" == "true" ] ; then
git commit -am "Create ${{ needs.set-context.outputs.release_version }} release"
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
echo " - ❌ A problem occurs when attempting to push create relase commits to ${{ needs.set-context.outputs.release_branch }} branch."
exit 1
echo " - ✅ no changes"
fi
- name: Archive artifacts