Skip to content

Commit 6c6ed21

Browse files
George Wangfacebook-github-bot
George Wang
authored andcommitted
Auto-retry failed CI builds once (facebookresearch#3718)
Summary: Pull Request resolved: facebookresearch#3718 As title Differential Revision: D60697701
1 parent 0b2328f commit 6c6ed21

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

.github/workflows/build.yml

+11
Original file line numberDiff line numberDiff line change
@@ -262,3 +262,14 @@ jobs:
262262
- uses: ./.github/actions/build_conda
263263
with:
264264
label: main
265+
rerun:
266+
permissions: write-all
267+
name: Activate rerun workflow
268+
if: fromJSON(github.run_attempt) < 2
269+
runs-on: ubuntu-latest
270+
steps:
271+
- env:
272+
GH_REPO: ${{ github.repository }}
273+
GH_TOKEN: ${{ github.token }}
274+
GH_DEBUG: api
275+
run: gh workflow run retry_build.yml -F run_id=${{ github.run_id }}

.github/workflows/retry_build.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Retry Build
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
run_id:
6+
required: true
7+
jobs:
8+
rerun-on-failure:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: rerun ${{ inputs.run_id }}
12+
env:
13+
GH_REPO: ${{ github.repository }}
14+
GH_TOKEN: ${{ github.token }}
15+
GH_DEBUG: api
16+
run: |
17+
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
18+
gh run rerun ${{ inputs.run_id }} --failed

0 commit comments

Comments
 (0)