Skip to content

Commit c5c7956

Browse files
gtwang01aalekhpatel07
authored andcommitted
Specify to retry only on failed jobs (facebookresearch#3772)
Summary: Pull Request resolved: facebookresearch#3772 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. Reviewed By: kuarora, junjieqi, ramilbakhshyiev Differential Revision: D61489426 fbshipit-source-id: 6dcef6ba422634bb333e44a5b12c74c5d3b3df8f
1 parent b7df795 commit c5c7956

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)