6
6
steps :
7
7
- name : Start verdaccio
8
8
run : |
9
-
9
+ # This version supports Node.js v22
10
+
10
11
while ! nc -z localhost 4873; do
11
12
echo "Verdaccio not running yet"
12
13
sleep 1
@@ -18,25 +19,30 @@ runs:
18
19
- name : Install and run npm-cli-login
19
20
shell : bash
20
21
env :
21
- NPM_REGISTRY : http://localhost:4873/
22
+ NPM_REGISTRY_HOST : localhost:4873
23
+ NPM_REGISTRY : http://localhost:4873
22
24
NPM_USER : verdaccio
23
25
NPM_PASS : verdaccio
24
26
25
27
run : |
26
- npm i -g npm-cli-adduser
27
- npm-cli-adduser
28
- sleep 1
29
- - name : Configure registry and git
28
+ # Make the HTTP request that npm addUser makes to avoid the "Exit handler never called" error
29
+ TOKEN=$(curl -s \
30
+ -H "Accept: application/json" \
31
+ -H "Content-Type:application/json" \
32
+ -X PUT --data "{\"name\": \"$NPM_USER\", \"password\": \"$NPM_PASS\", \"email\": \"$NPM_EMAIL\"}" \
33
+ $NPM_REGISTRY/-/user/org.couchdb.user:$NPM_USER 2>&1 | jq -r '.token')
34
+
35
+ # Set the Verdaccio registry and set the token for logging in
36
+ yarn config set registry $NPM_REGISTRY
37
+ npm set registry $NPM_REGISTRY
38
+ npm set //"$NPM_REGISTRY_HOST"/:_authToken $TOKEN
39
+ - name : Configure git
30
40
shell : bash
31
41
working-directory : ./amplify-js
32
42
env :
33
- NPM_REGISTRY : http://localhost:4873/
34
43
NPM_USER : verdaccio
35
- NPM_PASS : verdaccio
36
44
37
45
run : |
38
- yarn config set registry $NPM_REGISTRY
39
- npm set registry $NPM_REGISTRY
40
46
git config --global user.email $NPM_EMAIL
41
47
git config --global user.name $NPM_USER
42
48
git status
0 commit comments