Repository navigation
fix(unpinned-images): treat images of drop-in forks of docker/build-push-action as local - #328
Conversation
…ush-action as local An image that useblacksmith/build-push-action, depot/build-push-action or warpbuilds/build-push-action builds is local, like one of docker/build-push-action: they take the same tags, load, push and outputs inputs. The recognised actions are now a set. Fixes #327 Co-authored-by: tedserbinski <57771+tedserbinski@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Recognize build-push actions rule_unpinned_images_scripts.go |
The local-image collector uses a shared set of four build-push action names to identify local images from tags inputs. Existing handling for metadata, bake, and load actions remains unchanged. |
Test and document action recognition rule_unpinned_images_scripts_test.go, testdata/unpinned_images/build_push_fork.yaml, docs/checks.md |
Tests cover the four recognized actions, the default-profile fork workflow, and an unknown action. The fixture builds and loads app:ci before running it. The documentation lists the three added replacements. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Merge Risk: 
Minimal · up to 0c77f
-
The unpinned-images rule now treats tags built by the Blacksmith, Depot and WarpBuild build-push actions as local images, matching the existing docker/build-push-action behavior and the documentation. No blocking risk remains.
Pre-merge checks: 
5
-
Full details: Title check
-
Explanation
The title names the fix (treating images from drop-in forks of docker/build-push-action as local) and the affected rule (unpinned-images). The changeset adds useblacksmith, depot, and warpbuilds build-push-action forks to the local-image collector, with tests and docs updates to match. The title covers the main change, though it does not mention the fixed set of four actions or the docker/build-push-action base case.
Full details: Linked Issues check
-
Explanation
Issue
#327requiresuseblacksmith/build-push-actionimages to count as local when the workflow uses the action's build inputs. The collector now recognizes that action and three named alternatives throughbuildPushActions, and it records theirtagsvalues as local images. The tests cover all four actions, the issue workflow under the default profile, and an unknown action that must still produce a finding. The related cross-job behavior is explicitly separate work and is not required for this objective.
Full details: Out of Scope Changes check
-
Explanation
The changes stay within issue
#327. The code change implements local-image recognition. The tests verify recognized actions, the issue reproduction, and the non-recognized-action boundary. The documentation updates the rule description. No unrelated behavior or unrelated files are changed.
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (2 skipped: 2 unsupported.)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
`unpinned-images` now reports an image in a script when the image is built in a different job. Each job runs on its own runner, so an image that job `build` builds and loads isn't there for job `use`: `docker run app:ci` pulls `app:ci` from the registry. Before this change, an image built anywhere in the workflow suppressed the finding in every job. This is the "Related" part of #327; the first part, the drop-in forks of `docker/build-push-action`, was #328, and this branch is on top of it. The workflow from the issue: ```yaml jobs: build: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - uses: actions/checkout@3d3c42e # v7 with: persist-credentials: false - uses: docker/build-push-action@c3c9e26 # v7.4.0 with: context: . load: true tags: app:ci use: runs-on: ubuntu-24.04 timeout-minutes: 10 steps: - run: docker run --rm app:ci true ``` Before (`main`): ``` $ jactionlint .github/workflows/repro.yml $ echo $? 0 ``` After: ``` $ jactionlint .github/workflows/repro.yml .github/workflows/repro.yml:24:30: image "app:ci" of "docker run" in this script is pinned by a tag, which can be moved to another image. pin it to a digest like "app:ci@sha256:{digest}" [unpinned-images] | 24 | - run: docker run --rm app:ci true | ^~~~~~ $ echo $? 1 ``` An image that a step of the same job builds, tags or loads is still not reported. <details> <summary>Changes and validation</summary> - `collectLocalImages` reads only the steps of the current job, and the local-image state is reset in `VisitJobPre` instead of `VisitWorkflowPre`. A composite action is a single synthesized job, so all of its steps still count. - `localUnknown` is per job too. A `docker load`, `docker compose`, `docker/bake-action`, `docker/load-action`, buildah or kaniko in another job puts nothing on this job's runner. To use an image from another job, the job loads it from an artifact (`docker load`), and that load counts. - A literal tag that one job pushes (`docker push ghcr.io/o/app:ci`) and another job runs is now reported. That run pulls a mutable tag from the registry, which a concurrent run can move. - `TestUnpinnedImagesLocalImagesUseTheShellOfTheirJob` (from #211) pinned the old cross-job behaviour. It now checks the job's shell (`defaults.run.shell: bash` on Windows) within a single job, and expects the cross-job image to be reported. - New tests in `rule_unpinned_images_scripts_test.go` cover an image of another job built by `docker/build-push-action`, by `docker build`, tagged by `docker tag`, and after `docker load` or `docker/bake-action` in the other job. All of them are reported. A further test covers the same image built in two jobs: only the job that doesn't build it is reported. - `docs/checks.md`: the "Images in scripts" bullets now say "the same job", plus a sentence on images of other jobs. - `mise run lint` passes. `mise run test`: every package passes except `TestShellcheckConfigWithRealShellcheck`, which also fails on `main` in this sandbox (shellcheck can't read `/tmp`) and passes in CI. On a loaded machine the root package hit the 10-minute `-race` timeout, so I reran it with `-race -timeout 30m`, and it passes (692s). </details> 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> <!-- coderabbit-ai-generated:v1 --> ## Summary by CodeRabbit * **Bug Fixes** * Unpinned image checks now treat images built or loaded in another job as external, so they can be reported even if another job created them. * Images built, tagged, or loaded within the current job remain exempt from findings. * **Tests** * Added coverage for images shared across jobs and for images created and used within the same job. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: tedserbinski <57771+tedserbinski@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
🤖 I have created a release *beep* *boop* --- ## [2.5.0](v2.4.0...v2.5.0) (2026-11-04) ### Features * **run:** add jactionlint run --list ([#316](#316)) ([f1f877e](f1f877e)) * **run:** add the OS sandbox that steps run in (Landlock, seccomp, Seatbelt) ([#319](#319)) ([443b4c1](443b4c1)) * **run:** container jobs, services, Docker actions, --container, --parallel, --dry-run ([#323](#323)) ([27dae22](27dae22)) * **run:** evaluate workflow expressions in jactionlint run --list ([#317](#317)) ([f4267f7](f4267f7)) * **run:** local actions cache, --net=proxy and jactionlint cache ([#322](#322)) ([b51ca88](b51ca88)) * **run:** run actions and reusable workflows ([#321](#321)) ([782e8f9](782e8f9)) * **run:** run workflow steps in the sandbox ([#320](#320)) ([65614de](65614de)) * **unreachable-required-check:** report required checks that never report ([#331](#331)) ([a4f08e3](a4f08e3)) ### Bug Fixes * **dependabot-syntax:** support apm package ecosystem ([#333](#333)) ([c7eafd3](c7eafd3)) * **unpinned-images:** only count images built in the same job ([#329](#329)) ([a09969d](a09969d)) * **unpinned-images:** treat images of drop-in forks of docker/build-push-action as local ([#328](#328)) ([4d0fcf6](4d0fcf6)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Mechanical release and regenerated metadata/version pins; no application logic changes in this diff. > > **Overview** > **Release 2.5.0** bumps the project version from **2.4.0** to **2.5.0** everywhere release-please manages: manifest, GitHub Action default, pre-commit Docker hook, docs site version, and CI/hooks examples. > > **CHANGELOG.md** gains the **2.5.0** section (notably the expanded **`jactionlint run`** work, **unreachable-required-check**, Dependabot **apm** support, and **unpinned-images** fixes described there). > > **Embedded linter data** is refreshed: **`event_payloads.go`** updates the pinned OpenAPI checksum comment; **`popular_actions.go`** and **`popular_actions.json`** add newer **`dawidd6/*`** tags, extra **`actions/setup-dotnet@v6`** and Pulumi inputs, and matching Node runtime entries. > > <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 622e287. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
unpinned-imagesnow treats an image built by a drop-in replacement ofdocker/build-push-actionas local, the same way as one built bydocker/build-push-actionitself. A laterdocker run app:cino longer asks for a digest that the registry can't provide. Fixes #327.The recognised build actions are now a set (
buildPushActions):docker/build-push-action,useblacksmith/build-push-action,depot/build-push-actionandwarpbuilds/build-push-action. Theirtags:are local images. An action outside the set that happens to take atags:input still has its image reported.Before and after
The repro from the issue, default profile, no config file:
Before (
mainat ad5f1f1):After (this branch):
Which forks were added, and why
I added only actions whose
action.ymldeclares the sametags,load,pushandoutputsinputs asdocker/build-push-action, with the same descriptions:docker/build-push-actionuseblacksmith/build-push-actionestargzwarpbuilds/build-push-actionapi-key,profile-name,timeoutdepot/build-push-actionproject,token,save,buildx-fallbackand othersI looked for
namespacelabs/nscloud-build-push-action,runs-on/build-push-action,cirruslabs/build-push-actionandubicloud/build-push-action. None of them exists or has anaction.yml, so none was added. No configuration option was added, because the rule has no existing place for a list of build actions.Tests
TestUnpinnedImagesInScriptscovers the build-from-another-step case for each of the four actions. It also lints the issue's workflow (testdata/unpinned_images/build_push_fork.yaml) with the default profile and expects no finding.tags:input (example/not-a-build-action) still hasapp:cireported.mise run lintpasses.go test -race ./...passes, exceptTestShellcheckConfigWithRealShellcheck. That test fails the same way onmainat ad5f1f1 in my sandbox, whereshellcheckcan't read the test's rc file under/tmp. CI passes it onmain.The repro isn't in
testdata/ok/: that harness lints with an empty config instead of the default profile, so the old code passes it too.Not in this PR
The issue also says that built tags are collected across the whole workflow, not per job. An image built in one job hides a
docker runof it in a job that never builds it.collectLocalImagesdoes read every job of the workflow. That is a separate change to the rule's scope and is left for its own PR.🤖 Generated with Claude Code
Summary by CodeRabbit