Skip to content

Commit b1d64e9

Browse files
committed
fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container
The Docker bundler for `functions deploy` only passes `NPM_CONFIG_REGISTRY` to the container environment. When `.npmrc` uses \${NPM_AUTH_TOKEN} for private registry authentication, the variable is not available inside the container, causing 401 errors. Forward `NPM_AUTH_TOKEN` from the host environment to the Docker container, following the same pattern established in PR #3020 for `NPM_CONFIG_REGISTRY`. Closes #4927
1 parent 111bf90 commit b1d64e9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

internal/functions/deploy/bundle.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ func (b *dockerBundler) Bundle(ctx context.Context, slug, entrypoint, importMap
6868
if custom_registry := os.Getenv("NPM_CONFIG_REGISTRY"); custom_registry != "" {
6969
env = append(env, "NPM_CONFIG_REGISTRY="+custom_registry)
7070
}
71+
if authToken := os.Getenv("NPM_AUTH_TOKEN"); authToken != "" {
72+
env = append(env, "NPM_AUTH_TOKEN="+authToken)
73+
}
7174
// Run bundle
7275
if err := utils.DockerRunOnceWithConfig(
7376
ctx,

0 commit comments

Comments
 (0)