feat(docker-release): opt-in private-modules BuildKit secret for unvendored Go fetch - #26
Merged
Merged
Conversation
…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>
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.
Summary
private-modulesinput (defaultfalse) to the reusabledocker-release.yml. Whentrue, mints a short-lived, read-onlypinpredict-argocdApp token and hands it tobuildxas BuildKit secretid=gh_token— so a service Dockerfile can fetch a private pinpredict module (e.g.github.com/pinpredict/ppkit) viaRUN --mount=type=secret,id=gh_token ... go mod downloadinstead of committing avendor/tree.--secret, never a--build-arg, so the token never lands in an image layer ordocker history. The token step isif:-gated and the secret is only appended when a token was minted.falsekeeps 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— cleanBOOTSTRAP_APP=pinpredict-argocd(id 3187934),repository_selection: all+contents: write, so a minted token can readppkitprivate-modules: trueand dropsvendor/; confirm itsdocker-releaserun on merge-to-main builds the image with the mounted secretprivate-modules) are unaffected on their next image build🤖 Generated with Claude Code