Skip to content

feat(docker-release): opt-in private-modules BuildKit secret for unvendored Go fetch - #26

Merged
blairham merged 1 commit into
mainfrom
feat/docker-private-go-module-secret
Jul 2, 2026
Merged

feat(docker-release): opt-in private-modules BuildKit secret for unvendored Go fetch#26
blairham merged 1 commit into
mainfrom
feat/docker-private-go-module-secret

Conversation

@blairham

@blairham blairham commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds an opt-in private-modules input (default false) to the reusable docker-release.yml. When true, mints a short-lived, read-only pinpredict-argocd App token and hands it to buildx as BuildKit secret id=gh_token — so a service Dockerfile can fetch a private pinpredict module (e.g. github.com/pinpredict/ppkit) via RUN --mount=type=secret,id=gh_token ... go mod download instead of committing a vendor/ tree.
  • Passed as a --secret, never a --build-arg, so the token never lands in an image layer or docker history. The token step is if:-gated and the secret is only appended when a token was minted.
  • Default false keeps this a no-op for every existing caller (callers pin @main, so blast radius matters). First consumer is covenant (un-vendoring ppkit, follow-up PR).

Test plan

  • actionlint .github/workflows/docker-release.yml — clean
  • Verified BOOTSTRAP_APP = pinpredict-argocd (id 3187934), repository_selection: all + contents: write, so a minted token can read ppkit
  • Covenant follow-up PR sets private-modules: true and drops vendor/; confirm its docker-release run on merge-to-main builds the image with the mounted secret
  • Confirm existing callers (no private-modules) are unaffected on their next image build

🤖 Generated with Claude Code

…ndored Go fetch

Adds a `private-modules` input (default false) to the reusable docker-release
workflow. When true it mints a short-lived, read-only pinpredict-argocd App
token and hands it to `buildx` as BuildKit secret `id=gh_token`, so a service
Dockerfile can fetch a private pinpredict module (e.g. github.com/pinpredict/ppkit)
via `RUN --mount=type=secret,id=gh_token ... go mod download` instead of
committing a vendor/ tree.

Passed as a `--secret`, never a `--build-arg`, so the token never lands in an
image layer or `docker history`. Default false keeps this a no-op for every
existing caller (the token step is skipped and the secret is omitted).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blairham
blairham merged commit f7b3aa3 into main Jul 2, 2026
2 checks passed
@blairham
blairham deleted the feat/docker-private-go-module-secret branch July 5, 2026 14:36
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