mirror of
https://github.com/aljazceru/Auto-GPT.git
synced 2026-01-07 16:24:19 +01:00
Retry push until successful (#208)
Signed-off-by: Merwane Hamadi <merwanehamadi@gmail.com>
This commit is contained in:
21
.github/workflows/ci.yml
vendored
21
.github/workflows/ci.yml
vendored
@@ -228,10 +228,23 @@ jobs:
|
||||
git commit -m "${commit_message}"
|
||||
git stash
|
||||
current_branch=${{ github.ref_name }}
|
||||
git fetch origin $current_branch
|
||||
git rebase origin/$current_branch
|
||||
git push origin HEAD
|
||||
poetry run python send_to_googledrive.py || echo "Failed to upload to Google Drive"
|
||||
attempts=0
|
||||
max_attempts=3
|
||||
|
||||
while [ $attempts -lt $max_attempts ]; do
|
||||
git fetch origin $current_branch
|
||||
git rebase origin/$current_branch
|
||||
if git push origin HEAD; then
|
||||
echo "Success!"
|
||||
poetry run python send_to_googledrive.py || echo "Failed to upload to Google Drive"
|
||||
exit 0
|
||||
else
|
||||
echo "Attempt $(($attempts + 1)) failed. Retrying..."
|
||||
attempts=$(($attempts + 1))
|
||||
fi
|
||||
done
|
||||
|
||||
echo "Failed after $max_attempts attempts."
|
||||
env:
|
||||
GDRIVE_BASE64: ${{ secrets.GDRIVE_BASE64 }}
|
||||
GITHUB_REF_NAME: ${{ github.ref_name }}
|
||||
|
||||
Reference in New Issue
Block a user