Repository navigation
ci(image-scan): scan the newest published images and pin Trivy by digest - #612
Merged
Merged
Conversation
The weekly scan defaulted to `latest`, which is published only for a stable version, so every run logged "not published" and passed without scanning anything. A scheduled run now resolves the newest version tag from the registry, `latest` when a stable version exists, and the newest sha- image of main, and scans each digest once. It fails when an expected image is missing. Trivy runs by the same TRIVY_VERSION and TRIVY_DIGEST pair as ci.yml and pulls the image by digest, without the Docker socket. Closes #520
Retry transient registry and API errors so a single GHCR 5xx does not fail the run, while a missing tag still fails at once. Report how many newer main commits had no published image and which commit was scanned, so a broken publish job is visible. Skip the scan on forks, keep the raw tag input out of workflow commands, and bound both jobs with timeouts.
jsenecal
marked this pull request as ready for review
November 25, 2026 20:24
WilhelmZA
reviewed
Nov 25, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed at 4eef5526.
GitHub marks the head merge commit as unverified because the commit email is not verified. Please recreate the merge commit using a verified commit email, sign it, and push again. Every commit must show as verified before approval.
# Conflicts: # CHANGELOG.md
jsenecal
force-pushed
the
ci/520-image-scan
branch
from
November 25, 2026 20:45
4eef552 to
b442393
Compare
Collaborator
Author
|
Thanks. The merge commit was made with a wrong local commit email. It's recreated with the verified address and signed, with the same parents and the same tree, so the content is unchanged. The new head is |
WilhelmZA
approved these changes
Nov 25, 2026
WilhelmZA
left a comment
Collaborator
There was a problem hiding this comment.
Approving at b442393b.
Checked image selection, digest pinning and CI; all commits now verify.
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.
Closes #520
The weekly published image scan defaulted to
latest, which is published only for a stable version. No stable version exists yet, so every scheduled run logged "not published" and passed without scanning anything.Changes
resolvejob reads the GHCR tag list anonymously (the same access Trivy uses) and picks:3.0.0-rc.2today; a prerelease sorts before its version),latest, once a stable version tag exists. Before that it logs a notice; after it, a missinglatestis an error,sha-<commit>image of main, found by walking the last 100 commits on main.Each tag is resolved to its manifest digest with the pinned buildx, and tags that share a digest are scanned once. The run fails if no version tag or main image is found. When newer main commits have no image, a notice gives how many were skipped and the commit and date of the image scanned, so a broken publish job shows up.
hyperglass-community/hyperglass, so forks don't go red every week. Timeouts: 10 minutes for resolve, 30 for each scan.scanmatrix job runs Trivy on each digest, withfail-fast: false, so one finding doesn't hide the other images' results.aquasec/trivy:${TRIVY_VERSION}@${TRIVY_DIGEST}, the same pair asci.yml. The existing Renovate regex manager already matches the version line followed by the digest line, so it updates this file along withci.yml.release-imagejob does. The runner no longer pulls the image or mounts the Docker socket, and the registry login is gone.{}at the workflow level, withcontents: readonly onresolve.workflow_dispatchinputtagis now optional with an empty default. Empty scans the default set; a tag scans only that tag and fails if it isn't published. The input is checked against the OCI tag grammar and is never echoed into a workflow command.Verification
actionlint1.7.12 with shellcheck 0.11.0 reports nothing.3.0.0-rc.2andsha-f345e88d…, plus a notice forlatest.tag=3.0.0-rc.2resolves;tag=latestand an invalid tag fail. Pagination works with a page size of 7 (15 pages). With the newest main commit's image hidden, the skipped-commit notice appears and the previous commit's image is used, and against an unreachable registry the lookup retries three times and then fails.TRIVY_DIGESTmatchesdocker buildx imagetools inspect aquasec/trivy:0.74.0.3.0.0-rc.2has one fixable HIGH (libxml2 CVE-2026-86144, fixed in 2.13.9-r3), so the first run after merge is expected to fail on that leg. That is the scan doing its job. The fix is the next release, since the main image already has it.Testing after merge
Run "Published image scan" from the Actions tab (
workflow_dispatch) withtagleft empty. The resolve job's summary lists the tags and digests, and each one gets its own scan job. To test a single image, run it withtagset, for example3.0.0-rc.2.