diff --git a/.gitea/workflows/build-lab.yml b/.gitea/workflows/build-lab.yml index 6b951c6..b3bf160 100644 --- a/.gitea/workflows/build-lab.yml +++ b/.gitea/workflows/build-lab.yml @@ -157,6 +157,9 @@ jobs: fi SHA="${{ gitea.sha }}" git commit -m "deploy(lab): render ${SHA:0:12} [skip ci]" - # --autostash: gradlew.bat and mvnw.cmd show as modified in a fresh checkout (line endings). - git pull --rebase --autostash origin "${{ gitea.ref_name }}" - git push origin "HEAD:${{ gitea.ref_name }}" + # No rebase: gradlew.bat and mvnw.cmd always show as modified in a checkout (line endings), + # and git will not rebase a dirty tree. If the branch moved during the run, run it again. + git push origin "HEAD:${{ gitea.ref_name }}" || { + echo "::error::${{ gitea.ref_name }} moved while this job ran; run the workflow again" + exit 1 + }