workflows: git push with backoff

ported from linuxbrew-core
master
Dawid Dziurla 2020-05-05 13:41:46 +02:00
parent 39df0a6f9f
commit cb374ce51a
No known key found for this signature in database
GPG Key ID: 7B6D8368172E9B0B
1 changed files with 3 additions and 2 deletions

View File

@ -80,13 +80,14 @@ jobs:
brew pr-pull --verbose ${{github.event.client_payload.pull_request}}
- name: Push bottle commit
run: |
for try in $(seq 10); do
for try in $(seq 20); do
git fetch
git rebase origin/master
if git push; then
exit 0
else
sleep $(shuf -i 3-10 -n 1)
max=$(( $try + 10 ))
sleep $(shuf -i 3-$max -n 1)
fi
done
exit 1