cli / cli/cli

Ability to view specific job's step logs

Open
#11,157 7 comments 0 reactions 0 assignees View on GitHub
enhancement gh-run needs-investigation
Dominant language
Go
Stars
46.3k
Forks
9k
Avg merge
2d 9h
Merged PRs (30d)
89

Description

### Describe the feature or problem you’d like to solve

Currently the `gh` cli allows you to view a job's logs with:
```sh
gh run view -R neovim/neovim --log --job=43904694235
```

This fetches the entire output of the job.

**I would like the ability to only view logs of a specific step of the job.**

The GitHub UI does fetch a specific step logs by calling:
```
https://github.com/neovim/neovim/commit/7935cf4f7f35150d3c04e719938046d4cfa8f905/checks/43904694235/logs/2
```
This endpoint is not exposed by the GitHub API.

### Proposed solution

I would imagine something like:
```sh
gh run view -R neovim/neovim --log --job=43904694235 --step=3
```

An alternative solution would be to solve https://github.com/orgs/community/discussions/41351 which would add more accurate timestamps to a step's `startedAt` and `completedAt`.
This would allow me to correlate the steps logs from the full job logs.

### Additional context

I would like to build a UI similar to github's job page.
The page allows the user to expand the different steps of the job, and see only the correlated logs.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.