diff --git a/.github/actions/load-verdaccio-with-amplify-js/action.yml b/.github/actions/load-verdaccio-with-amplify-js/action.yml index acdfb22fd14..98dc00b64ec 100644 --- a/.github/actions/load-verdaccio-with-amplify-js/action.yml +++ b/.github/actions/load-verdaccio-with-amplify-js/action.yml @@ -18,32 +18,29 @@ runs: - name: Install and run npm-cli-login shell: bash env: - NPM_REGISTRY: http://localhost:4873/ + NPM_REGISTRY_HOST: localhost:4873 + NPM_REGISTRY: http://localhost:4873 NPM_USER: verdaccio NPM_PASS: verdaccio NPM_EMAIL: verdaccio@amplify.js run: | - curl -s \ + TOKEN=$(curl -s \ -H "Accept: application/json" \ -H "Content-Type:application/json" \ -X PUT --data "{\"name\": \"$NPM_USER\", \"password\": \"$NPM_PASS\", \"email\": \"$NPM_EMAIL\"}" \ - $NPM_REGISTRY-/user/org.couchdb.user:$NPM_USER \ - && curl -s \ - -H "Accept: application/json" \ - -H "Content-Type:application/json" \ - -X PUT --data "{\"name\": \"$NPM_USER\", \"password\": \"$NPM_PASS\", \"email\": \"$NPM_EMAIL\"}" \ - --user $NPM_USER:$NPM_PASS $NPM_REGISTRY-/user/org.couchdb.user:$NPM_USER + $NPM_REGISTRY-/user/org.couchdb.user:$NPM_USER 2>&1 | jq -r '.token') + yarn config set registry $NPM_REGISTRY + npm set registry $NPM_REGISTRY + npm set //"$NPM_REGISTRY_HOST"/:_authToken $TOKEN - name: Configure registry and git shell: bash working-directory: ./amplify-js env: - NPM_REGISTRY: http://localhost:4873/ + NPM_REGISTRY: http://localhost:4873 NPM_USER: verdaccio NPM_PASS: verdaccio NPM_EMAIL: verdaccio@amplify.js run: | - yarn config set registry $NPM_REGISTRY - npm set registry $NPM_REGISTRY git config --global user.email $NPM_EMAIL git config --global user.name $NPM_USER git status