Skip to content

gh run view --log should make it possible to get line-based output even if step name is multi-line #13687

Description

@mkq

Describe the feature or problem you’d like to solve

Job names can be multi-line, for example when defined as name: "deploy: ${{ toJSON(inputs) }}" as some of our jobs do. (The web UI for this looks okay, and viewing the raw log for a single job there does not add the job and step name to every line anyway, so is not affected.)

However, command gh run view --repo=$repo --log $runId shows all jobs and prepends job and step name to every line with unchanged multi-line job name. This makes the output bloated and harder to analyze with line-based tools.

This example shows the two last lines of a "good" job "create-deployment" and the first line of the "bad" job "deploy: { … }" (output slightly modified):

» gh run view --repo=$repo --log $runId | grep -P -B10 -m1 '^\}'
create-deployment	Complete job	2026-06-18T06:52:50.3150960Z Cleaning up orphan processes
create-deployment	Complete job	2026-06-18T06:52:50.3400384Z ##[warning]Node.js 20 is deprecated. The following actions target Node.js 20 but are being forced to run on Node.js 24:…
deploy: {
  "<input1>": "<value1>",
  "<input2>": "<value2>",
  "<input3>": "<value3>",
  "<input4>": "*",
  "<input5>": "main",
  "<input6>": "main",
  "<input7>": true
}	UNKNOWN STEP	2026-06-18T06:52:57.8184473Z Current runner version: '2.335.1'

Even the single-job command gh run view --repo=$repo --log --job=$jobId includes the job name (unlike the web UI) which is not that useful in that case anyway.

Proposed solution

  1. Please add an option to leave out the job name for each line,
  2. an option to print extra header lines which mark the start of a job and include its name,
  3. an option to leave out the step name for each line,
  4. an option to print extra header lines which mark the start of a step and include its name and the parent job name.

Options 1 and 2 could also be combined into one option: Enabling a job name header could automatically remove the job name from every normal line.
Similarly, options 3 and 4 could be combined: Enabling a step (plus job) name header could automatically remove the step name from every normal line.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-runrelating to the gh run command

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions