fix(ci): build PR images with a read-only token; publish only from main - #2179
Merged
Merged
Conversation
Contributor
🔍 Rendered manifest diff — this PR vs
|
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.
What
Splits the single
build-container-images.yml(PR + push + dispatch) into two workflows:check-container-images.yml(new)pull_requestonlycontents: readworkflow-widepush: falsebuild-container-images.yml(keeps the name)main+workflow_dispatchcontents: read,packages: write,security-events: write(job-level)push: true, Trivy/SARIFWhy
The old job held
packages: writeonpull_requestwhile checking out the PR head and running PR-controlled build code. Fork PRs were saved only by GitHub's read-only fork token; same-repo PRs were not — any same-repo PR could overwrite published image tags. All four published images are consumed via mutablev*tag pins, so a tag overwrite reaches workloads (openbao-snapshot CronJob, headlamp-plugin-app, token-exchange-proxy, pev2). Verified exposure evidence in the SDD reportf5-packages-write-report.md(same directory as the fix report below).This is the remedy the SP3 plan's Task 6.3 names ("split the push out of the PR path"), so that plan's future workflow-secrets lint passes with no exception for this job.
Preserved by construction
Build Container Images, so main's group key (Build Container Images-refs/heads/main) is unchanged across the transition; the PR file keeps today's PR semantics (cancel-in-progress: true).type=raw,value=<app-version>(v*) line is verbatim in both; each file lists only what its triggers can express (structurally-dead conditionals dropped, each a no-op for the surviving trigger).gh workflow run build-container-images.ymland every existing link to the filename still target the workflow that builds and publishes.Docs corrected to match
container-images/README.mdandci-workflows.mdupdated truthfully — including correcting the "immutable<branch>-<sha>" pinning claim: consumers pin the mutablev*tags, not digests.docs/architecture/ci-pipeline.drawio's same false claims corrected (PR cell: read-only, never pushes or scans; publish cell: deployments pin thev*tag — mutable, not a digest);ci-pipeline.svgregenerated with the pinned drawio.Verification
YAML parse of both files (
exit 0); structural self-check passed (PR triggers exactlypull_request, every PR job ⊆contents: read, no login step, publish triggers exactlypush/workflow_dispatch, pins verbatim,push: false/trueas mapped);validate-links.sh,validate-doc-claims.sh,verify-doc-paths.shallexit 0; pre-commit green over the staged diffs. One transient at merge time: an in-flight PR run started under the old workflow name will not be cancelled by a newer run under the new one — it finishes and is ignored; main's queue is unaffected.Detail and review evidence:
.superpowers/sdd/2026-09-27-agent-dark-factory-plan/f5-fix-report.md(exposure analysis inf5-packages-write-report.md) in theo1-agent-observabilityworktree.Out of scope, flagged: consumers' mutable-
v*-tag pinning itself (digest-pinning, GHCR immutability settings) is unchanged.