fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container#4933
fix(functions): forward NPM_AUTH_TOKEN to deploy bundler container#4933addniner wants to merge 1 commit intosupabase:developfrom
Conversation
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 supabase#3020 for
`NPM_CONFIG_REGISTRY`.
Closes supabase#4927
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughThe pull request modifies the bundle deployment logic to read the Assessment against linked issues
Tip Try Coding Plans. Let us write the prompt for your AI agent so you can ship faster (with fewer bugs). Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Summary
The Docker bundler for
functions deployonly passesNPM_CONFIG_REGISTRYto the container environment (added in #3020). When.npmrcuses${NPM_AUTH_TOKEN}for private registry authentication, the variable is not available inside the container, causing 401 errors.This PR forwards
NPM_AUTH_TOKENfrom the host environment to the Docker container, following the same pattern established in #3020.Reproduction
supabase functions deploy hello(.npmrcwith${NPM_AUTH_TOKEN})401 unauthenticatedNPM_AUTH_TOKEN=xxx supabase functions deploy hello401 unauthenticated(env not forwarded to container).npmrcwith hardcoded tokenNPM_AUTH_TOKEN=xxxwith patched CLITested with a private package (
@addniner/test-private-pkg) on GitHub Packages, with Docker cache cleared between attempts.Change
3-line addition in
internal/functions/deploy/bundle.go, same pattern as the existingNPM_CONFIG_REGISTRYforwarding:Closes #4927