How to migrate npmToken? #31253
-
What would you like help with?I would like help with my configuration How are you running Renovate?Mend Renovate hosted app on github.com If you're self-hosting Renovate, tell us which platform (GitHub, GitLab, etc) and which version of Renovate.No response Please tell us more about your question or problemI have this in my configuration:
Now I was warned that I need to migrate my secret. I created a repository secret on I tried:
and also
but none of these approaches works and I cannot find an example in the documentation. The first one threw this error: Logs (if relevant)Logs
|
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 3 replies
-
i.e. no more |
Beta Was this translation helpful? Give feedback.
-
For context, my original setup—which needed migration—looks like this: "encrypted": {
"npmToken": "wcFMA/xDdHCJBTolAQ/........."
}
"npmrc": "@<ORG_NAME>:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${NPM_TOKEN}", Note
I couldn't get I've tried:
Neither worked. // WARNING: This does not work
"npmToken": "{{ secrets.NPM_TOKEN }}",
"npmrc": "@<ORG_NAME>:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${NPM_TOKEN}", What worked for me is to introduce it as a "hostRules": [
{
"matchHost": "https://npm.pkg.github.com/",
"hostType": "npm",
"token": "{{ secrets.NPM_TOKEN }}"
}
],
"npmrc": "@<ORG_NAME>:registry=https://npm.pkg.github.com/\n//npm.pkg.github.com/:_authToken=${NPM_TOKEN}", |
Beta Was this translation helpful? Give feedback.
-
Quick question around this solution: Should we use the same name in both properties, as in the example below?
|
Beta Was this translation helpful? Give feedback.
-
Regarding this string: "npmrc": "@fortawesome:registry=https://npm.fontawesome.com\n//npm.fontawesome.com/:_authToken=${{ secrets.NPM_TOKEN }}", I think it should be like this (note the absense of "npmrc": "@fortawesome:registry=https://npm.fontawesome.com\n//npm.fontawesome.com/:_authToken={{ secrets.NPM_TOKEN }}", |
Beta Was this translation helpful? Give feedback.
For context, my original setup—which needed migration—looks like this:
Note
<ORG_NAME>
is replaced with the actual organization name that contains private NPM packagesI couldn't get
npmToken
to work again after migrating to secret and unwrapping it from theencrypted
object. Renovatebot complains that it has no access to the private packages, indicating it has issues accessing the secret.I've tried: