Sub topic 3
Reading a step log
This chapter covers what a single step's log contains and how to read it quickly. It assumes you can already open a failed run and find the failing step, which the previous chapter covers. It also assumes you can read basic YAML and shell commands.
What a step log is made of
Every step in a job produces its own section of the job log. Runner output is the text the step writes to standard output and standard error. The runner adds its own lines around that text. A step log has these parts:
- A header line that shows what ran, such as
Run npm ciorRun actions/checkout@v4. - Context lines inside the header group: the shell used, the
env:values, and thewith:inputs for actions. - The output of the command itself.
- Error or warning lines, which the UI colors red or yellow.
- A final status, usually shown by the step's icon, and sometimes a line such as
Process completed with exit code 1.
Besides your own steps, a job always has Set up job at the start and Complete job at the end. If you use actions/checkout, it also gets a post step (Post Run actions/checkout@v4) that runs at cleanup. Set up job is worth opening once. It lists the runner image and version, and it shows the GITHUB_TOKEN permissions the job received. Both help when a failure depends on the environment.
Groups
The log is organized into collapsible groups. Each step is one group. The runner also emits a group for the step's header, so the command and its environment fold away.
Your own commands can create more groups with workflow commands:
steps:
- name: Install and build
run: |
echo "::group::Install dependencies"
npm ci
echo "::endgroup::"
echo "::group::Build"
npm run build
echo "::endgroup::"Anything printed between ::group:: and ::endgroup:: folds under the title you gave. Many tools, including some test runners and build tools, emit groups themselves.
Groups can hide the failure. When a step fails, GitHub usually expands the failing step automatically. Groups you created inside that step stay collapsed unless an error line sits inside them. If the last visible lines look harmless, expand every group in the failing step before you decide there is no error.
Raw lines versus what the UI shows
The page renders the log. The raw text has extra markers. If you download the log or open the raw view, you see lines like this:
2026-12-04T14:03:51.2591234Z ##[group]Run npm ci
2026-12-04T14:03:51.2592011Z npm ci
2026-12-04T14:03:51.2610020Z shell: /usr/bin/bash -e {0}
2026-12-04T14:03:51.2611180Z ##[endgroup]
2026-12-04T14:03:52.1200045Z npm error code ENOENT
2026-12-04T14:03:52.1201933Z npm error path /home/runner/work/demo/demo/package.json
2026-12-04T14:03:52.1450002Z ##[error]Process completed with exit code 254.The markers mean:
| Marker | Meaning |
|---|---|
| `##[group]` and `##[endgroup]` | Start and end of a collapsible section |
| `##[error]` | An error line. It creates a red annotation. |
| `##[warning]` | A warning line. It creates a yellow annotation. |
| `##[debug]` | Appears only when debug logging is on |
| `***` | A secret value that the runner masked |
The text before each marker is a timestamp in UTC. The UI hides these by default, but you can turn them on from the gear menu at the top right of the log. Timestamps are ISO 8601 with a Z suffix, with sub-second precision.
Timestamps
Timestamps show where time went and in what order things happened. Three uses come up often:
- Finding slow steps. Compare the first and last timestamp of a step. A dependency install that takes four minutes instead of twenty seconds points to a missing or broken cache.
- Spotting hangs. A long gap with no output, followed by a timeout or cancellation, usually means a command is waiting for input or a network call is stuck.
- Ordering parallel output. When a tool runs tasks in parallel, lines from different tasks interleave. Timestamps show which task wrote what and when.
Treat the timestamps as the runner's clock when it received the line. They are not the exact moment the tool produced the output, because output is buffered.
Error lines and what they really say
Red lines in the log are not all equally useful. They come from two sources:
- The runner. For a
runstep, it addsProcess completed with exit code N.when the shell exits non-zero. This line tells you that the step failed, but not why. - Your tools. Lines such as
npm error,ModuleNotFoundError, orFAIL src/app.test.jsare written by the programs you ran. They tell you why.
The runner's line is nearly always the last error in the step. The useful line is usually above it. This is the first habit to build: when you see Process completed with exit code 1., scroll up. The next chapters cover how to pick the root cause when several errors appear.
The exit code can still be informative. In the sample above, 254 is what npm returned for a missing package.json. That differs from the 1 many test runners return for failed tests. Note the number, but don't rely on it alone.
Reading a failing log: a worked example
Take the workflow from the plan's baseline, where package.json lives in app/ and not at the repository root. The log of the npm ci step looks like this in raw form:
2026-12-04T14:03:51.4001000Z ##[group]Run npm ci
2026-12-04T14:03:51.4002000Z npm ci
2026-12-04T14:03:51.4003000Z shell: /usr/bin/bash -e {0}
2026-12-04T14:03:51.4004000Z ##[endgroup]
2026-12-04T14:03:51.9000000Z npm error code ENOENT
2026-12-04T14:03:51.9001000Z npm error syscall open
2026-12-04T14:03:51.9002000Z npm error path /home/runner/work/demo/demo/package.json
2026-12-04T14:03:51.9003000Z npm error errno -2
2026-12-04T14:03:51.9004000Z npm error enoent Could not read package.json
2026-12-04T14:03:51.9500000Z ##[error]Process completed with exit code 254.Read it in this order:
- The header group shows the command (
npm ci) and the shell. Noworking-directoryappears, so the command ran in the default directory, the repository root. - The first tool error is
ENOENT, "no such file or directory", and the path is the repository root pluspackage.json. - The runner's last line only confirms the step failed.
The conclusion follows from the log alone: the command ran in the wrong directory. The fix is the defaults.run.working-directory: app setting shown in the plan's second workflow. Later chapters cover how to apply and verify it.
Navigating a long log
Real logs run to thousands of lines. These tools keep you from scrolling:
- Search. The search box at the top of the log filters to lines that match. Try
error,fail, or a package name. It searches across the steps of the job you have open. - Line links. Clicking a line number puts an anchor in the URL, such as
#step:4:12for step 4, line 12. Paste it into a pull request or chat so others land on the same line. - Download. The gear menu lets you download the log archive, a zip with one text file per job step. It is easier to search with
grepthan the web page is. - Raw view. This shows the unrendered text, with the
##[...]markers and timestamps.
Logs are kept for a limited time, 90 days by default, and a repository or organization can lower that. A very old run may have no logs, even though its status still shows.
Output you will not see
Three kinds of output are easy to miss:
- Masked values. Registered secrets are replaced by
***. If a path or URL contains one, part of the line is hidden, and that can make a log look odd. This is intended. - Debug lines.
##[debug]lines only appear when debug logging is enabled for the run. A later chapter shows how to turn it on. - Output after a crash. If the runner is lost, for example after running out of memory or being cancelled, the last lines of the step may never be sent. The log then stops abruptly without any error line.
How to read a step log: a checklist
- Open the failing step and read its header group first. Confirm the command, the shell, and the values in
env:orwith:. - Locate the runner's exit-code line. Treat it as the end of the story, not the cause.
- Scan upward for the first line a tool wrote that describes a problem.
- If you find nothing, expand all groups and turn on timestamps.
- Save a line link and the exact message. You will need them for the next steps.
Exercise
A step log ends with "##[error]Process completed with exit code 1." The ten lines above it show test output and "FAIL src/cart.test.js". Which line is the runner's and which is the tool's? Name two things you could do if the failing test output were inside a collapsed group you created with ::group::.
Show answer
"Process completed with exit code 1." is the runner's line. It only reports that the step failed. "FAIL src/cart.test.js" comes from the test tool and describes the cause. For the collapsed group, you could expand it by clicking its title, or download the log archive and search it with grep for "FAIL" or "error", which ignores grouping.