chore: retry workflow for r2 uploading (#1517)

This commit is contained in:
Huang Xin
2025-07-02 23:37:05 +08:00
committed by GitHub
parent 446b014f7d
commit e54440ad80
2 changed files with 29 additions and 3 deletions
+18
View File
@@ -0,0 +1,18 @@
name: Retry workflow
on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun:
runs-on: ubuntu-latest
steps:
- name: rerun ${{ inputs.run_id }}
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed
+11 -3
View File
@@ -20,8 +20,6 @@ jobs:
timeout-minutes: 3
strategy:
fail-fast: false
matrix:
attempt: [1, 2, 3]
env:
RELEASE_R2_BUCKET: readest-releases
RELEASE_R2_ACCOUNT_ID: ${{ secrets.RELEASE_R2_ACCOUNT_ID }}
@@ -66,4 +64,14 @@ jobs:
- name: Upload successful
if: success()
run: echo "Upload completed successfully on attempt ${{ matrix.attempt }}"
run: echo "Upload completed successfully"
retry-on-failure:
if: failure() && fromJSON(github.run_attempt) < 3
needs: [upload-to-r2]
runs-on: ubuntu-latest
steps:
- env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ github.token }}
run: gh workflow run retry-workflow.yml -F run_id=${{ github.run_id }}