Skip to content

feat(setup-go): opt-in private-modules for unvendored private Go fetch - #29

Merged
blairham merged 1 commit into
mainfrom
feat/setup-go-private-modules
Jul 2, 2026
Merged

feat(setup-go): opt-in private-modules for unvendored private Go fetch#29
blairham merged 1 commit into
mainfrom
feat/setup-go-private-modules

Conversation

@blairham

@blairham blairham commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

Adds a private-modules opt-in to the setup-go composite — the non-Docker analogue of the private-modules BuildKit secret added to docker-release.yml in #26. For standalone Go repos (e.g. k4a) that build binaries, not images, and want to fetch a private pinpredict module (github.com/pinpredict/ppkit, tuikit) in CI instead of committing a vendor/ tree.

When private-modules: true, the composite:

  1. mints a short-lived, read-only pinpredict-argocd App token (actions/create-github-app-token@v1, owner: pinpredict, permission-contents: read) from the BOOTSTRAP_APP_ID / BOOTSTRAP_APP_PRIVATE_KEY inputs;
  2. sets a scheme-scoped git config --global url."…@github.com/pinpredict/".insteadOf "https://github.com/pinpredict/" and GOPRIVATE=github.com/pinpredict/*, so go / golangci-lint / goreleaser fetch privately over HTTPS.

Default false → no-op for every existing caller (covenant, service-template, …): the token step is skipped and no git rewrite happens.

First consumer will be k4a (un-vendoring ppkit+tuikit) in a follow-up PR pinned to @main.

🤖 Generated with Claude Code

Add a `private-modules` input (default false) to the setup-go composite.
When true it mints a short-lived, read-only pinpredict-argocd App token
(from private-modules-app-id / private-modules-app-private-key) and configures
git — a scheme-scoped `insteadOf` for github.com/pinpredict/ — plus GOPRIVATE,
so `go`, `golangci-lint`, and `goreleaser` fetch a private pinpredict module
(e.g. github.com/pinpredict/ppkit) over HTTPS instead of failing on the public
proxy. This is the non-Docker analogue of docker-release.yml's `private-modules`
BuildKit secret, for standalone Go repos (k4a) that build binaries rather than
images and don't want to commit a vendor/ tree.

Default false keeps this a no-op for every existing caller — the token step is
skipped and no git rewrite happens.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@blairham
blairham merged commit 6553e35 into main Jul 2, 2026
2 checks passed
@blairham
blairham deleted the feat/setup-go-private-modules branch July 2, 2026 22:19
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