Inspect PR images without publishing them
I added a PR-only image build and scan in the PR image-scan commit. A contributor’s change can be packaged and inspected before it is eligible to publish an image or enter the signing chain. The job’s explicit permissions and unpushed local image are the concrete separation in this patch.
The inspected code establishes the intended behavior. The historical PR screenshot supplies context without establishing that every later workflow change executed in that pictured run.
- Before
No dedicated PR image scan
- After
Local unpushed PR image + scan
- Evidence boundary
Configured exceptions and remote branch enforcement remain separate.
Text equivalent and limits
- No dedicated PR image scan
- Local unpushed PR image + scan
- Configured exceptions and remote branch enforcement remain separate.
Read the labeled relationships as the stated contract. Optional connections are dashed and explicitly labeled; comparisons do not imply a sequential handoff. This figure explains inspected code or recorded observations, not current cloud execution.
The source problem
Section titled “The source problem”The parent workflow was organized around publishing a release candidate. It did not include this local PR image job. Source checks and a final container image answer different questions: the image includes the runtime base and packaged application, so scanning only source files does not describe the assembled artifact.
That is current engineering reasoning about the change. The patch does not contain a documented incident or a measured reduction in vulnerability risk, and this case makes neither claim.
What I changed
Section titled “What I changed”The new pull-request trigger targets main, and the new job runs only for the pull_request event. Docker build uses push false and load true, with a local PR tag and the current Git SHA build argument. Trivy scans that local image with HIGH/CRITICAL severity and exit code 1, writing SARIF that the upload step attempts even when the scan fails.
| PR job contract | Source-defined behavior |
|---|---|
| Cloud token permission | Explicit job permissions omit id-token. |
| Registry publication | Docker build does not push. |
| Image availability for scanning | The image is loaded into the runner. |
| Finding threshold | Trivy HIGH/CRITICAL with exit code 1. |
| Exceptions | The existing .trivyignore applies. |
| Review output | SARIF upload uses the job’s security-events permission. |
The pinned deploy workflow retains this job. The separate PR Check workflow performs its own static checks. Their names must not be used to substitute one workflow’s permissions or steps for the other.
What the screenshot establishes
Section titled “What the screenshot establishes”The pictured open PR has passing security checks. Its visible proposal discusses moving the PR image scan into PR Check. That is a proposal in a recorded screen, not proof that the baseline implemented that move: the final scan remains in deploy.yml.

Evidence boundary: The proposal asks for review before merging and moves PR Image Scan into PR Check; it does not establish merge approval or the pinned baseline workflow split.
No execution revision is borrowed from later CI screenshots, and this contextual capture has no linked recorded-execution evidence ID. The original collection date comes from the owner’s source README, not from this website review.
Trade-off and lesson
Section titled “Trade-off and lesson”A local image scan extends inspection while keeping registry publication outside this PR job. It still builds contributor-controlled code on a runner; the patch is not a proof of complete sandbox isolation.
The exception file narrows the blocking result. Passing means no reported, nonignored finding crosses the configured threshold for that scan. It does not mean every vulnerability was rejected, every exception was independently revalidated, or a future database produces the same result.
A passing PR scan also does not authorize release. The later exact-verification change adds canonical-main guards and claim assertions to the privileged chain. In the pinned baseline, workflow guards limit that chain while the cloud federation condition remains repository-scoped. The useful lesson is to inspect event conditions, job permissions, publication flags and dependency outputs together rather than assuming a green PR grants release authority.