Skip to content

gh run watch --exit-status does not exit with failure status code for already failed jobs #3962

@michaele-blend

Description

@michaele-blend

Describe the bug

gh version 1.12.1 (2021-07-01)
https://github.com/cli/cli/releases/tag/v1.12.1

gh run watch --exit-status does not exit with failure status code for already failed jobs.

Steps to reproduce the behavior

Pick an already-failed action run ID, and attempt the following:

gh run watch ${FAILED_RUN_ID} --exit-status
# Run [workflow name] (73829) has already completed with 'failure'
echo $?
# 0

Expected vs actual behavior

I expected gh run watch ${FAILED_RUN_ID} --exit-status to exit with a non-zero exit code.

Logs

The above steps to reproduce include sufficiently redacted logs of the issue that I observed.
The logs from my machine are the comment lines.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions