Describe the bug
gh pr checks prints a blank summary line when a PR's only checks were cancelled. The expected "Some checks were cancelled" message never appears.
gh version 2.x (current trunk).
Steps to reproduce
Run gh pr checks <PR> on a pull request whose only check runs are in the cancelled state (e.g. a single workflow run that was cancelled, with no other passing/failing/pending/skipped checks).
Expected vs actual
- Expected: a summary line such as
Some checks were cancelled.
- Actual: a blank line; no summary is printed.
Root cause
printSummary (pkg/cmd/pr/checks/output.go) gates the whole summary block on:
if counts.Failed+counts.Passed+counts.Skipping+counts.Pending > 0 {
counts.Canceled is omitted, so a cancelled-only result sums to 0, the block is skipped, and the else if counts.Canceled > 0 { "Some checks were cancelled" } branch becomes unreachable in exactly the case it was written for.
A fix (add counts.Canceled to the guard) plus a regression test is ready in #13679 if this is accepted.
Describe the bug
gh pr checksprints a blank summary line when a PR's only checks were cancelled. The expected "Some checks were cancelled" message never appears.gh version2.x (currenttrunk).Steps to reproduce
Run
gh pr checks <PR>on a pull request whose only check runs are in the cancelled state (e.g. a single workflow run that was cancelled, with no other passing/failing/pending/skipped checks).Expected vs actual
Some checks were cancelled.Root cause
printSummary(pkg/cmd/pr/checks/output.go) gates the whole summary block on:counts.Canceledis omitted, so a cancelled-only result sums to0, the block is skipped, and theelse if counts.Canceled > 0 { "Some checks were cancelled" }branch becomes unreachable in exactly the case it was written for.A fix (add
counts.Canceledto the guard) plus a regression test is ready in #13679 if this is accepted.