Skip to content

feat(docker-release): add opt-in private-modules token for stevedore builds#44

Merged
blairham merged 2 commits into
mainfrom
feat/docker-release-private-modules
Jul 6, 2026
Merged

feat(docker-release): add opt-in private-modules token for stevedore builds#44
blairham merged 2 commits into
mainfrom
feat/docker-release-private-modules

Conversation

@blairham

@blairham blairham commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What

Ports the private-modules opt-in from the frozen matrix docker-release.yml@pre-stevedore onto the stevedore implementation on main.

  • New private-modules boolean input (default false).
  • When true, a gated step mints a short-lived read-only pinpredict-argocd App token (contents: read) and exposes it as GH_PRIVATE_TOKEN to the stevedore step.
  • The caller's .stevedore.yaml declares secrets: [{id: gh_token, env: GH_PRIVATE_TOKEN}]; stevedore hands it to buildx as a --secret (never a --build-arg), so a Dockerfile can RUN --mount=type=secret,id=gh_token ... go mod download a private github.com/pinpredict/ppkit without vendoring. The token never lands in an image layer or docker history.

Why

Unblocks migrating Go repos that fetch private pinpredict modules (covenant, and any future un-vendored Go service) off the frozen matrix pin — that was the one docker-release capability the stevedore rewrite didn't yet carry.

Inert until turned on

Default false → no token minted, GH_PRIVATE_TOKEN empty → stevedore skips an env-backed secret whose variable is unset (blairham/stevedore#10). Zero effect on every current caller.

Sequencing (before any repo flips it on)

  1. Merge + release the env-gating in stevedore (feat(builder): skip env-backed secrets whose variable is unset blairham/stevedore#10 → v0.0.7).
  2. Bump this workflow's stevedore-version default to that release — required for local private-module builds (in CI the token is always present when opted in, so it works on any version, but local stevedore build needs the skip behavior). The GH_PRIVATE_TOKEN comment notes this.
  3. Consumer repo adds the gh_token secret to .stevedore.yaml + private-modules: true at its ci.yml flip.

Test

actionlint clean on docker-release.yml.

🤖 Generated with Claude Code

blairham and others added 2 commits July 6, 2026 11:15
…builds

Port the `private-modules` opt-in from the frozen matrix implementation
onto the stevedore docker-release. When `private-modules: true`, mint a
short-lived read-only pinpredict-argocd App token and expose it as the
GH_PRIVATE_TOKEN env var to the stevedore step. The caller's
.stevedore.yaml wires it to a BuildKit secret
(`secrets: [{id: gh_token, env: GH_PRIVATE_TOKEN}]`), so a Dockerfile can
`go mod download` a private pinpredict module (e.g. ppkit) without
vendoring — passed as a --secret, never a --build-arg, so it never lands
in an image layer.

Default false — inert for every existing caller: no token is minted, the
env is empty, and stevedore (>= the env-gated release) skips an env-backed
secret whose variable is unset. Bump stevedore-version to that release
before any repo turns private-modules on.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v0.0.7 (blairham/stevedore#10) skips an env-backed build secret whose
variable is unset, so the private-modules gh_token secret stays inert on
callers that leave it off and local private-module builds work. Bump the
pinned action ref in lockstep.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blairham
blairham merged commit 204d737 into main Jul 6, 2026
2 checks passed
@blairham
blairham deleted the feat/docker-release-private-modules branch July 6, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant