File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -148,7 +148,15 @@ runs:
148148 run : |
149149 commit_changes () {
150150 if [[ ${{ steps.preparation.outputs.push }} == "true" ]]; then
151- git add . && git commit -m "Release ${{ inputs.docker-registry }}/${{ inputs.docker-image }}:${{ steps.preparation.outputs.tag }}"
151+ git add .
152+
153+ # commit with no errors if there are no changes
154+ if git diff-index --quiet HEAD; then
155+ echo "There were no changes..."
156+ return
157+ fi
158+
159+ git commit -m "Release ${{ inputs.docker-registry }}/${{ inputs.docker-image }}:${{ steps.preparation.outputs.tag }}"
152160 # In case there was another push in the meantime, we pull it again
153161 git pull --rebase https://${{ inputs.gitops-user }}:${{ inputs.gitops-token }}@github.com/${{ inputs.gitops-organization }}/${{ inputs.gitops-repository }}.git
154162 git push https://${{ inputs.gitops-user }}:${{ inputs.gitops-token }}@github.com/${{ inputs.gitops-organization }}/${{ inputs.gitops-repository }}.git
You can’t perform that action at this time.
0 commit comments