diff --git a/.github/workflows/build-asan.yml b/.github/workflows/build-asan.yml index d453bfb76..ea70227f0 100644 --- a/.github/workflows/build-asan.yml +++ b/.github/workflows/build-asan.yml @@ -34,4 +34,8 @@ jobs: git config --global user.email "alexhultman@gmail.com" git config --global user.name "Alex Hultman" git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} ASAN binaries" || true - git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries-asan + # Another job can push in between: then its commit is taken and the push tried again, up to three + # times. One line, because PowerShell and bash both read && and || left to right. -X theirs keeps + # this job's version of a file both changed, like source_commit + git remote set-url --push origin "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" + git push origin binaries-asan || git pull --rebase -X theirs origin binaries-asan && git push origin binaries-asan || git pull --rebase -X theirs origin binaries-asan && git push origin binaries-asan || git pull --rebase -X theirs origin binaries-asan && git push origin binaries-asan diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 963bfe194..2703718ab 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,4 +42,8 @@ jobs: git config --global user.email "alexhultman@gmail.com" git config --global user.name "Alex Hultman" git commit -a -m "[GitHub Actions] Updated ${{ matrix.os }} binaries" || true - git push "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" binaries + # Another job can push in between: then its commit is taken and the push tried again, up to three + # times. One line, because PowerShell and bash both read && and || left to right. -X theirs keeps + # this job's version of a file both changed, like source_commit + git remote set-url --push origin "https://unetworkingab:${{ secrets.SECRET }}@github.com/uNetworking/uWebSockets.js" + git push origin binaries || git pull --rebase -X theirs origin binaries && git push origin binaries || git pull --rebase -X theirs origin binaries && git push origin binaries || git pull --rebase -X theirs origin binaries && git push origin binaries