Skip to content

Commit ca3d477

Browse files
loispostulaolblak
andauthored
feat: add example for private registry auth on npm autodiscovery (#2584)
Co-authored-by: Olivier Vernin <[email protected]>
1 parent f580b88 commit ca3d477

File tree

1 file changed

+34
-1
lines changed
  • content/en/docs/plugins/autodiscovery

1 file changed

+34
-1
lines changed

content/en/docs/plugins/autodiscovery/npm.adoc

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,40 @@ Then for each of them, it tries to update them.
2525

2626
==== Example
2727

28+
===== Basic Example
29+
30+
[source,yaml]
31+
----
32+
# updatecli.d/npm.yaml
33+
autodiscovery:
34+
crawlers:
35+
npm:
36+
rootdir: "."
37+
versionfilter:
38+
kind: semver
39+
pattern: minor
40+
----
41+
42+
===== Private Registry Example
43+
44+
The following example shows how to configure npm autodiscovery to work with a private npm registry:
45+
2846
[source,yaml]
2947
----
30-
# updatecli.d/default.yaml
48+
# updatecli.d/npm-private.yaml
49+
autodiscovery:
50+
crawlers:
51+
npm:
52+
rootdir: "."
53+
# URL of your private npm registry
54+
url: "https://npm.example.com"
55+
# Authentication token (use environment variables for security)
56+
registrytoken: "${NPM_TOKEN}"
57+
# Optional: path to custom .npmrc file
58+
npmrcpath: "/path/to/.npmrc"
59+
versionfilter:
60+
kind: semver
61+
pattern: ">=1.0.0"
3162
----
63+
64+
NOTE: The `url`, `registrytoken`, and `npmrcpath` parameters are propagated to all generated npm resource specs, allowing consistent authentication across all discovered dependencies.

0 commit comments

Comments
 (0)