Skip to content

Commit e2f1fac

Browse files
gtwang01facebook-github-bot
authored andcommitted
Specify to retry only on failed jobs
Summary: It looks like there are many failures on the retry build workflow, but these are mainly due to retry attempts with the --failed flag being unable to rerun workflows that don't have any failed jobs. Differential Revision: D61489426
1 parent 924c24d commit e2f1fac

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

.github/workflows/retry_build.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,10 @@ jobs:
1616
GH_DEBUG: api
1717
run: |
1818
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
19-
gh run rerun ${{ inputs.run_id }} --failed
19+
20+
# Only retry if there are failed jobs
21+
if gh run view ${{ inputs.run_id }} --exit-status; then
22+
echo Workflow succeeded - no retry necessary.
23+
else
24+
gh run rerun ${{ inputs.run_id }} --failed
25+
fi

0 commit comments

Comments
 (0)