The following npm config set, in my "run" section does not work in my GitHub action.
npm config set //my.registry.io/npm/:_auth {{ secret.NPM_ACCESSTOKEN }}
I know the value of secret.NPM_ACCESSTOKEN is correct, I've been able to verify with an alternative method.
However I need to use the npm config set _auth value method instead of using a ".npmrc".
I've tried a variety of methods for example:
token=$(echo "$(curl -u "$UsernameKey" $Uri)" | extract_token()
npm config set _auth $token
This returns me exactly the same value as the one stored in GH secrets and works successfully. However means I'm making an additional request with the curl.
After double checking all the secrets and passing them into an env (via GitHub) action. The following was the working solution.
Note that I did provide single quotes around the
env.NPM_ACCESSTOKENand_authinstead_authTokenworked for me. (thanks @azeem)