Describe the bug
When gh run rerun --failed is invoked on a workflow that did not complete yet (and thus is not re-runnable at least in the web UI), the command prints "run .... cannot be rerun; its workflow file may be broken", which does not indicate actual reason of the failure
$ gh --version
gh version 2.50.0 (2024-05-29)
https://github.com/cli/cli/releases/tag/v2.50.0
Steps to reproduce the behavior
- Create a workflow with multiple jobs so that one fails and one continues to run longer
- Create a PR, wait for the to-be-failed job to fail
- Obtain status checks for this PR e.g. with
gh pr checks "${pr_link}" --json 'link,bucket' --jq 'map(. | select(.bucket == "fail")' -- the job is reported as failed
- Obtain the run ID -- either from web UI or with something like
gh pr checks "${pr_link}" --json 'link,bucket' --jq 'map(. | select(.bucket == "fail") | .link | sub(".*/runs/(?<id>[0-9]+)/job/[0-9]+$"; "\(.id)") ) | unique | .[]'
- Attempt re-running the failed jobs:
gh run rerun --failed "${run_id}"
Expected vs actual behavior
Expected: gh run rerun to print something indicating that workflow/run cannot be rerun before it finishes
Actual: message not indicating what the actual problem is
Describe the bug
When
gh run rerun --failedis invoked on a workflow that did not complete yet (and thus is not re-runnable at least in the web UI), the command prints "run .... cannot be rerun; its workflow file may be broken", which does not indicate actual reason of the failureSteps to reproduce the behavior
gh pr checks "${pr_link}" --json 'link,bucket' --jq 'map(. | select(.bucket == "fail")'-- the job is reported as failedgh pr checks "${pr_link}" --json 'link,bucket' --jq 'map(. | select(.bucket == "fail") | .link | sub(".*/runs/(?<id>[0-9]+)/job/[0-9]+$"; "\(.id)") ) | unique | .[]'gh run rerun --failed "${run_id}"Expected vs actual behavior
Expected:
gh run rerunto print something indicating that workflow/run cannot be rerun before it finishesActual: message not indicating what the actual problem is