Specify to retry only on failed jobs (#3772)

Summary:
Pull Request resolved: https://github.com/facebookresearch/faiss/pull/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
This commit is contained in:
George Wang 2024-08-20 19:27:53 -07:00 committed by Facebook GitHub Bot
parent a10b883584
commit a43afd6a62

View File

@ -16,4 +16,10 @@ jobs:
GH_DEBUG: api
run: |
gh run watch ${{ inputs.run_id }} > /dev/null 2>&1
# Only retry if there are failed jobs
if gh run view ${{ inputs.run_id }} --exit-status; then
echo Workflow succeeded - no retry necessary.
else
gh run rerun ${{ inputs.run_id }} --failed
fi