Repository navigation
Description
Problem
The six image scan steps of .github/workflows/ci.yml and release.yml use aquasecurity/trivy-action v0.36.0. The action calls aquasecurity/setup-trivy v0.2.6 unless skip-setup-trivy is true. setup-trivy restores a cached binary, and on a cache miss it runs contrib/install.sh from the Trivy repository. That script downloads the release archive from GitHub with no retry option in the action. A GitHub outage with HTTP 5xx answers on a cache miss fails the scan step (the outage of #4215 and #4216; #4223 fixes the other release downloads).
Expected
Every image scan step gets Trivy from a download that retries on a 5xx answer and on a connect failure, and that checks the pinned SHA-256 of tools.lock. Candidate: install Trivy with devops install-tools --tool trivy --only-missing before the scan, and set skip-setup-trivy: true. The image jobs have no uv today, so the job also needs the step that sets it up, or the scan uses another pinned source.
Acceptance criteria
- A test fails for each
aquasecurity/trivy-actionstep that lets the action download Trivy. Command:uv run devops ci test tests/invariants/test_workflow_contracts.py. -
test_every_trivy_scan_runs_the_trivy_tools_lock_pinsstill proves that CI scans with the Trivy version oftools.lock.
Existing tool considered
devops install-tools, which retries after fix(ci): retry the GitHub release downloads #4223 and checks the SHA-256 oftools.lock.- The
skip-setup-trivyinput oftrivy-actionv0.36.0 (read in itsaction.yaml).
Related
- fix(ci): retry the GitHub release downloads #4223 (retry of the other release downloads).
Proposed design
Problem statement
The six image scan steps of ci.yml and release.yml let aquasecurity/trivy-action download Trivy through setup-trivy. On a cache miss that download has no retry, so a GitHub 5xx answer fails the scan step. The steps must get Trivy from devops install-tools, which retries after #4223 and checks the SHA-256 of tools.lock.
Acceptance criteria
Requirement: The action never downloads Trivy
Every aquasecurity/trivy-action step in .github/workflows SHALL set the input skip-setup-trivy to "true".
Scenario: A scan step lacks skip-setup-trivy
- WHEN The contract test reads a trivy-action step with no skip-setup-trivy input, or with a value other than "true".
- THEN The test fails and names the file, the job and the step.
Requirement: Trivy is installed before each scan
Each job that runs trivy-action SHALL run uv run devops install-tools --tool trivy --only-missing and add $HOME/.local/bin to GITHUB_PATH in a step before the scan step.
Scenario: A job scans with no install step
- WHEN The contract test reads a job whose scan step has no earlier Trivy install step.
- THEN The test fails and names the file and the job.
Requirement: The install step runs under the same condition as the scan
Each Trivy install step and toolchain step SHALL carry the same if condition as the scan step of its job, so that a skipped scan also skips the install.
Scenario: An install step runs when its scan is skipped
- WHEN The contract test reads a job whose scan step has an
ifand whose install step has a differentif. - THEN The test fails and names the file and the job.
Requirement: The job holds the tools to run the installer
Each job that installs Trivy SHALL check out the repository and set up the uv toolchain with ./.github/actions/setup-toolchain before the install step.
Scenario: An image job has no uv setup
- WHEN The contract test reads a job whose install step comes before the checkout or before the toolchain setup step.
- THEN The test fails and names the file and the job.
Requirement: CI scans with the Trivy version of tools.lock
The contract test SHALL keep the check that every scan step names the Trivy version that tools.lock pins, which the install step installs.
Scenario: The pinned version stays the scan version
- WHEN The test reads the version input of each of the six scan steps.
- THEN test_every_trivy_scan_runs_the_trivy_tools_lock_pins passes for the six steps and fails when one version differs from the tools.lock version.
Existing Tool Considered
Covered by existing project code and an existing action input. devops install-tools --tool trivy --only-missing already runs in the static job of ci.yml, it checks the SHA-256 of tools.lock, and it retries after #4223. The skip-setup-trivy input of trivy-action v0.36.0 turns off the setup-trivy download; the archived change of #4223 read it in the action.yaml. No check of alternatives has run. The change adds workflow steps and a changed contract test, and builds no new tool. Cost: one pull request, about 30k tokens and under one hour.
Key questions
- Which source gives Trivy to the six scan steps?: Use
devops install-tools --tool trivy --only-missingand set skip-setup-trivy to "true". The static job already uses this install, and it checks the SHA-256 of tools.lock. (best practice) [sources: .github/workflows/ci.yml, tests/invariants/test_workflow_contracts.py]- Chosen: devops install-tools plus skip-setup-trivy. It reuses the pinned and checked installer that the project already runs, and it gets retries from fix(ci): retry the GitHub release downloads #4223.
- Rejected: Keep setup-trivy and retry the scan step. The retry would run the whole scan again, and the download keeps no SHA-256 check from tools.lock.
- Rejected: Download the archive with curl --retry in each job. It adds code that duplicates install-tools and needs its own SHA-256 pin.
- Does the trivy-action v0.36.0 have an input that skips the download?: Yes. The input is skip-setup-trivy. Unless it is true, the action calls setup-trivy v0.2.6, which restores a cache and on a miss runs contrib/install.sh. The action has no retry input. [sources: openspec/changes/archive/2026-11-09-4223-retry-the-download-of-a-release/proposal.md]
- How do the image jobs get uv?: Add ./.github/actions/setup-toolchain after the checkout in each job that scans. Use a cache-suffix for each job and set save-uv-cache to "false", as the other jobs do. In ci.yml give the setup and install steps the same
ifas the scan step (image_changes for three jobs, the crawl4ai filter for the third-party job). (best practice) [sources: .github/workflows/ci.yml]- Chosen: Use ./.github/actions/setup-toolchain. Every other job that runs
uv run devopsuses it, and the contract tests already read its use. - Rejected: Install uv with a separate action. It adds a second way to get uv and a new pinned action.
- Chosen: Use ./.github/actions/setup-toolchain. Every other job that runs
- Does the change need fix(ci): retry the GitHub release downloads #4223 first?: No. The change of fix(ci): retry the GitHub release downloads #4223 is archived in the repository, so install-tools already retries. No dependency is left. [sources: openspec/changes/archive/2026-11-09-4223-retry-the-download-of-a-release/proposal.md]
- Does the version input of trivy-action still matter when skip-setup-trivy is true?: Keep the
versioninput on each scan step, equal to the tools.lock version. The input is harmless if the action ignores it, and the existing contract test keeps it equal to tools.lock. The installed version comes from tools.lock through install-tools. (best practice) [sources: tests/invariants/test_workflow_contracts.py:462, CHANGELOG.md]- Chosen: Keep the version input equal to the tools.lock pin. The existing test stays valid, and the scanned version cannot drift.
- Rejected: Remove the version input. It changes the existing contract test and risks a different default if the action reads the input.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Alternatives check of 2026-11-10: none.
Tool: none found.
Activity
dan-petty commentedon Nov 9, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones.
fixprefix of the title gives the type.(ci)scope of the title gives the scope.CI reliability fix that reduces repeated failures during outages but does not block all development.Prevents repeated CI scan failures during GitHub outages, saving rerun time.Requires workflow changes, a uv setup step, and an invariant test.Both address GitHub release download failures during outages, but the candidate fixes the action-internal Trivy download while #4223 fixes direct workflow downloads.devops-cli-service commentedon Nov 9, 2026
Refine cannot set this item to Ready at c034509 while the items below stay open. The next refine round looks at the item again when they close, or when a person replies in a comment or edits the body.
devops-cli-service commentedon Nov 9, 2026
Status set to Ready at 1700648 (see proposed design in issue body).
devops-cli-service commentedon Nov 10, 2026
Alternatives check: none
Reason: The searches surfaced only the Trivy setup path the workflow already uses (aquasecurity/setup-trivy, which restores a cache and then runs the non-retrying install script) and generic GitHub-release installers such as taiki-e/install-action, which verifies upstream SHA-256 checksums but installs only the tools in its own manifest (unlisted tools fall back to cargo-binstall) and reads no tools.lock. No open, maintained tool installs Trivy with a retry on 5xx/connect failures and the project's tools.lock SHA-256 pin, so the need stays with the repository's own
devops install-toolsplus the existingskip-setup-trivyinput.Tool: none found
Lacks:
Tools considered:
Searches run:
Sources:
Checked on 2026-11-10. A person decides what this means for the item. The check changes no label and closes no issue.
fix(ci): retry the Trivy download of the image scan steps
devops-cli-service commentedon Nov 18, 2026
Released in v0.177.1: https://github.com/dan-petty/devops-cli/releases/tag/v0.177.1
devops-cli-service commentedon Nov 18, 2026
Live since 2026-11-18 17:16 UTC