Skip to content

gh pr checks: blank summary when all checks were cancelled #13680

Description

@s3onghyun

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-prrelating to the gh pr command

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions