ci: rebase instead of force push in publish-report action
Build and Analyse / build-and-analyse (push) Successful in 24s
Build and Analyse / build-and-analyse (push) Successful in 24s
Force pushing the test report overwrote commits pushed while the workflow was running and led to duplicated history. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
36084e5fe9
commit
69e7b72ce3
1 file changed
+9
-1
@@ -125,4 +125,12 @@ runs:
|
||||
git add reports/
|
||||
git diff --cached --quiet && echo "No changes" && exit 0
|
||||
git commit -m "ci: update test report [skip ci]"
|
||||
git push --force origin ${{ github.ref_name }}
|
||||
# rebase onto commits pushed in the meantime instead of overwriting them;
|
||||
# on conflicts in reports/ the freshly generated report wins
|
||||
for attempt in 1 2 3; do
|
||||
git pull --rebase --autostash -X theirs origin ${{ github.ref_name }}
|
||||
git push origin ${{ github.ref_name }} && exit 0
|
||||
echo "Push rejected (attempt $attempt), retrying..."
|
||||
sleep 5
|
||||
done
|
||||
exit 1
|
||||
Reference in new issue
Block a user