fix: guard summary jq against null Entrypoint/Cmd/Env - #111
Merged
Conversation
The `Docker Inspect` summary step fed `.[0].Config.Entrypoint`,
`.Config.Cmd`, `.Config.Env`, and `.RootFS.Layers` straight into jq's
`join`/`.[]`/`to_entries`, all of which iterate their input. When an
image defines no `ENTRYPOINT` (and/or no `CMD`/`ENV`), those fields are
`null` in `docker inspect`, so jq aborts with:
jq: error (at inspect.json:NN): Cannot iterate over null (null)
Under the default `bash -e` shell that non-zero exit fails the whole
`Docker Build` step (exit code 5), even though the image built and
pushed fine — it only breaks the post-build job summary.
Every existing test fixture is `FROM nginx`, which inherits a non-null
entrypoint/cmd, so the summary path never hit a null field. Any image
without an entrypoint (e.g. a plain `FROM debian:trixie-slim`) trips it.
Guard each iterating expression with `// []` so null fields render as
empty instead of crashing. Populated images are unaffected.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Andriy Knysh (aknysh)
requested review from
Igor Rodionov (goruha) and
Erik Osterman (Cloud Posse) (osterman)
August 20, 2026 21:57
Erik Osterman (Cloud Posse) (osterman)
approved these changes
Aug 20, 2026
|
These changes were released in v3.2.1. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what
Docker Inspectjob-summaryjqexpressions againstnullfields by wrapping each iterating expression with// []:.[0].Config.Entrypoint | join(" ")→(.[0].Config.Entrypoint // []) | join(" ").[0].Config.Cmd | join(" ")→(.[0].Config.Cmd // []) | join(" ").[0].Config.Env[] | ...→(.[0].Config.Env // [])[] | ....[0].RootFS.Layers | to_entries[] | ...→(.[0].RootFS.Layers // []) | to_entries[] | ...why
The summary step (added in #98) feeds several
docker inspectfields straight into jq'sjoin,.[], andto_entries, all of which iterate their input. When an image defines noENTRYPOINT(and/or noCMD/ENV), those fields arenullindocker inspect, so jq aborts with:Under GitHub Actions' default
bash --noprofile --norc -e -o pipefailshell, that non-zero exit fails the entire Docker Build step with exit code 5 — even though the image built and pushed successfully. Only the post-build job summary is broken, but the whole job (and thus the release) reports failure.Every fixture in
test/isFROM nginx, which inherits a non-null entrypoint and cmd, so the summary path never exercised a null field. Any entrypoint-less image trips it — e.g. Atmos'sFROM debian:trixie-slimimage, whose release build hit exactly this:proof
Entrypoint: nullreproduces the failure with the old expression and is fixed by the new one; populated images are unaffected:references
ENTRYPOINT/CMD/ENV; introduced by the structured summary in Enhance Docker image summary with structured inspect output #98.inspect: true) run against the registry — happy to add as a follow-up if desired (the currenttest/*scenarios run withinspect: false).