6
6
steps :
7
7
- name : Start verdaccio
8
8
run : |
9
- # This version supports Node.js v22
10
-
9
+
11
10
while ! nc -z localhost 4873; do
12
11
echo "Verdaccio not running yet"
13
12
sleep 1
@@ -19,30 +18,25 @@ runs:
19
18
- name : Install and run npm-cli-login
20
19
shell : bash
21
20
env :
22
- NPM_REGISTRY_HOST : localhost:4873
23
- NPM_REGISTRY : http://localhost:4873
21
+ NPM_REGISTRY : http://localhost:4873/
24
22
NPM_USER : verdaccio
25
23
NPM_PASS : verdaccio
26
24
27
25
run : |
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
26
+ npm i -g npm-cli-adduser
27
+ npm-cli-adduser
28
+ sleep 1
29
+ - name : Configure registry and git
40
30
shell : bash
41
31
working-directory : ./amplify-js
42
32
env :
33
+ NPM_REGISTRY : http://localhost:4873/
43
34
NPM_USER : verdaccio
35
+ NPM_PASS : verdaccio
44
36
45
37
run : |
38
+ yarn config set registry $NPM_REGISTRY
39
+ npm set registry $NPM_REGISTRY
46
40
git config --global user.email $NPM_EMAIL
47
41
git config --global user.name $NPM_USER
48
42
git status
0 commit comments