Skip to content

Commit

Permalink
Auto-retry failed CI builds once (facebookresearch#3718)
Browse files Browse the repository at this point in the history
Summary:
Pull Request resolved: facebookresearch#3718

As title

Differential Revision: D60697701
  • Loading branch information
gtwang01 authored and facebook-github-bot committed Aug 4, 2024
1 parent 0b2328f commit 13adb8f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -262,3 +262,16 @@ jobs:
- uses: ./.github/actions/build_conda
with:
label: main
re-run:
name: Activate rerun workflow
if: fromJSON(github.run_attempt) < 2
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
steps:
- name:
run: |
gh workflow run retry_build.yml `
--raw-field run_id=${{ github.run_id }} `
--repo ${{ github.repository }}
if(!$?) { exit 1 }
17 changes: 17 additions & 0 deletions .github/workflows/retry_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Retry Build
on:
workflow_dispatch:
inputs:
run_id:
required: true
jobs:
rerun-on-failure:
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- name: rerun ${{ inputs.run_id }}
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
gh run rerun ${{ inputs.run_id }} --failed

0 comments on commit 13adb8f

Please sign in to comment.