Repository navigation
feat(build): expose an npmrc build secret for the botpress-private registry - #143
Merged
Merged
Conversation
…gistry The three build actions already forward `node-auth-token` to the Docker build as the `node_auth_token` secret, which leaves each Dockerfile to assemble an `.npmrc` from the raw token before running pnpm. To simplify this, the actions now also write a `.npmrc` for the `@botpress-private` registry on the runner and pass it as the `npmrc` secret file, so a Dockerfile can mount it directly with `--mount=type=secret,id=npmrc,target=/root/.npmrc` and nothing is ever written to an image layer. The raw `node_auth_token` secret is still passed, so existing Dockerfiles keep working.
sea-grass
approved these changes
Sep 16, 2026
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.
This PR adds a new build secret named
npmrcto thebuild/docker,build/depotandbuild/blacksmithactions, derived from the existingnode-auth-tokeninput. Dockerfiles can then mount it on the steps that need access to our private registry:RUN --mount=type=secret,id=npmrc,target=/root/.npmrc pnpm fetch --frozen-lockfileBuildKit exposes the file only for that instruction, so the credentials never end up baked in an image layer and the Dockerfile doesn't need to craft the file itself.
To ensure back-compat, the
node_auth_tokensecret is still passed, so Dockerfiles that read it keep working.