Skip to content

fix: scan one image tag in the SBOM step - #684

Merged
Jossec101 merged 1 commit into
mainfrom
fix/sbom-scan-single-tag
Nov 24, 2026
Merged

Jossec101 merged 1 commit into
mainfrom
fix/sbom-scan-single-tag

Conversation

@markettes

Copy link
Copy Markdown
Contributor

Every push to main since #651 has failed in the Scan SBOM step, after the image was already pushed. The step passes steps.meta.outputs.tags to anchore/scan-action, and on main that output is two lines, :main and :latest. scan-action v3.6.4 ended up scanning only :main; v7.4.2 hands the whole string to grype, which cannot parse it ("failed to parse reference ...:main\n...:latest"). It failed on #681's merge and on both attempts of #683's.

This scans the first tag from the metadata JSON instead, which is what v3 did. Release tags produce three tags, so the next release would have hit the same failure.

The PR's own CI can't show the fix: the scan only runs in docker-build, on a push to main or a tag. The merge of this PR is the test, and it should also leave ghcr.io/lunar-rails/nodeguard:main with a green build.

anchore/scan-action v7 passes its image input to grype as is, and on main the metadata tags output is two lines (:main and :latest), so grype could not parse it and every main build since #651 failed after pushing the image. Scan the first tag, as v3 did.
Copilot AI balanced review requested due to automatic review settings November 24, 2026 17:23

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change that passes a single Docker image reference to the SBOM scan.

No open issues 🎉

What changed in this PR

Fixes the Docker build’s SBOM scan failure introduced after the scan-action upgrade in #651 by passing a single image reference instead of a newline-separated tag list.

Changes:

  • Selects the first tag from Docker metadata JSON for scanning.
  • Adds a comment explaining why the full tag list cannot be passed to Grype.
File Description
.github/​workflows/​dotnet.yml Updates the SBOM scan input to use one image tag for main and release builds.

Review effort: Balanced

@lunar-patrol lunar-patrol Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Automated security review — no issues found

CI-only change: the SBOM scan now passes a single image reference (first tag from docker/metadata-action's JSON output) instead of the newline-separated tag list, fixing a grype parse failure. The tag values come from docker/metadata-action based on branch/tag refs and are passed as an action input, not concatenated into a shell command, so there is no injection surface. All tags for a push refer to the same built image digest, so scanning only the first tag loses no coverage. No exploitable defect found.

Reviewed 1 file at a2f0e82. Nothing to report.

Not a guarantee — one diff, no knowledge of your threat model.

🤖 Automated security review. It never pushes, approves or blocks; a suggestion applies only when you click Commit suggestion.

@Jossec101
Jossec101 merged commit 205da17 into main Nov 24, 2026
7 checks passed
@Jossec101
Jossec101 deleted the fix/sbom-scan-single-tag branch November 24, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants