-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No token found and can't prompt for login when running with --non-interactive. #81
Comments
Yarn requires - uses: actions/setup-node@v1
with:
always-auth: true |
@clarkbw thanks, I'll try it. |
Still don't work for me, but adding this line in below works. - run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc |
Hi, I have the same issue. One repo it works: https://github.com/comit-network/comit-js-sdk/ but then the same config does not work on a different repo: https://github.com/comit-network/create-comit-app/pull/243/checks?check_run_id=330403347 Is the solution above the official one or should we follow up with yarn to fix it? |
For me I just need to supply the following: steps:
- uses: actions/checkout@v2
- name: Publish new version to NPM
uses: actions/setup-node@v1
with:
node-version: 13.x
registry-url: 'https://registry.npmjs.org'
- run: yarn publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} https://help.github.com/en/actions/language-and-framework-guides/publishing-nodejs-packages This sets the always-auth automatically, as well as the registry and scope etc. |
@jorenbroekema suggestion worked for me |
Anything to doc or improve here? I see the link to help above and it sounds like it was enough. |
I've tried all the solutions above and none seems to work for me. Here are the various runs. And I have my npm token: And here is the action file. Anyone have an idea? |
@CSFlorin few things you can try: I suspect either the 2nd or the 1st suggestion will fix things for you. Don't think the third one matters but you could always try. |
@jorenbroekema Thanks for the suggestions but I had already tried all these. See the workflow file for this run. |
@CSFlorin You didn't try the third suggestion in that run. I doubt it matters, but it potentially could, if they use use a replacer / template parser where the spaces are relevant. I'm not sure what else it could be :\ Also, are you sure you have a secret in that repository called NPM_TOKEN ? Because the error your action gives seems to indicate that it cannot find your NPM_TOKEN secret. Maybe check spelling, and to be sure, delete the existing one and remake it maybe. |
I use below steps for yarn2
|
for uses: actions/setup-node@v1
with:
registry-url: 'https://registry.npmjs.org'
node-version: ${{ matrix.node-version }}
always-auth: true |
generated from commit da0680f
sorry for the questions if is stupid, but why the env in all the example is called I use |
OMG thank you - I've been trying every example I can find and getting nowhere. Tried |
|
* try to fix publish issue vis-a-vis actions/setup-node#81
Attempt to fix the release workflow. See actions/setup-node#81
So is there any way to get this to work with Yarn v2? The solution from @ndthanhdev obviously uses Powershell, but I'm using ubuntu... And also it looks a bit hacky. |
Hello everyone. I'm going to close the issue, because the documentation was updated after releasing tag v2. If you have any concerns feel free to create a separate issue or pull request with updating documentation. Hello @luxalpa. Actually you can use @ndthanhdev solution with bash, because this solution does not involve any powershell specific commands. |
@CSFlorin thanks for posting a link to your file, I figured by now you could have solved the problem, I copied your publish steps and it just works, so thanks! |
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.0.2 to 4.0.5. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v4.0.2...v4.0.5) Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
I encountered the same error and tried everyone's solution. The later error became that the token could not be found. After some inspection, I found that it was because a .npmrc file without a token field was written in the local project. I deleted the .npmrc file in the local project, and workflow could publish npm normally. |
In my repo I have the workflow like this:
I've added
NPM_AUTH_TOKEN
to secrets, but got this error:I have tried many times and can't figure it out. My repo is https://github.com/leadream/juuust-icon.
Can anyone help me? Thanks!
The text was updated successfully, but these errors were encountered: