Created
March 27, 2026 13:38
-
-
Save rhighs/18243b941dc96d7be8a014b82dab69d8 to your computer and use it in GitHub Desktop.
Rerun failed jobs under a Github PR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gh-rerun-failed() { | |
| local pr="${1:?Usage: gh-rerun-failed <PR_NUMBER>}" | |
| gh run list --json databaseId,status,conclusion \ | |
| --jq '.[] | select(.conclusion == "failure" or .conclusion == "startup_failure") | .databaseId' \ | |
| $(gh pr view "$pr" --json headRefName --jq '"--branch " + .headRefName') \ | |
| | xargs -I{} gh run rerun {} --failed | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment