.npmrc as a BuildKit secret and leaves your
source file unchanged.
It follows the same model as npmAuthenticate@0 in Azure DevOps.
Usage
buildcharts generate before docker buildx bake. Mount the secret when
installing packages:
What it does
- Reads default and scoped Azure Artifacts registries from
.npmrc. - Uses endpoint credentials from the environment, otherwise an environment token, otherwise the Azure Artifacts Credential Provider.
- Validates credentials returned by the provider. If rejected, forces one refresh before failing.
- Writes npm credentials to
.buildcharts/secrets/npmrcand adds the generated Bake secret. - Preserves existing credentials when no environment credentials replace them.
Environment variables
NPM_AUTHENTICATE_WORKING_FILENPM_AUTHENTICATE_HELPER_VERSIONARTIFACTS_CREDENTIALPROVIDER_EXTERNAL_FEED_ENDPOINTSARTIFACTS_CREDENTIALPROVIDER_ACCESSTOKENAZURE_ARTIFACTS_ENV_ACCESS_TOKENSYSTEM_ACCESSTOKENVSS_NUGET_ACCESSTOKEN(legacy)VSS_NUGET_EXTERNAL_FEED_ENDPOINTS(legacy)
ARTIFACTS_CREDENTIALPROVIDER_* is the preferred prefix. The older VSS_NUGET_* variables are legacy names kept for compatibility. See the Artifacts Credential Provider environment variables.Notes
- The plugin only authenticates Azure DevOps-hosted npm feeds.
- If no matching npm sources are found, the plugin skips authentication.
