Skip to content
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 for gpr-publish #156

Closed
AjayPoshak opened this issue May 10, 2020 · 9 comments
Labels
bug Something isn't working

Comments

@AjayPoshak
Copy link

AjayPoshak commented May 10, 2020

When I run yarn publish in github action for GPR, I get following error

yarn publish v1.22.4
warning package.json: No license field
warning package.json: No license field
[1/4] Bumping version...
info Current version: 2.0.0-beta.3
[2/4] Logging in...
error No token found and can't prompt for login when running with --non-interactive.
info Visit https://yarnpkg.com/en/docs/cli/publish for documentation about this command.
##[error]Process completed with exit code 1.

Meanwhile it works fine for NPM publish flow.
My workflow configuration: https://github.com/AjayPoshak/instagram-story/blob/master/.github/workflows/npmpublish.yml

@baptisteArno
Copy link

Same error. Did you make it work @AjayPoshak?

@AjayPoshak
Copy link
Author

@baptisteArno nope.

@manovotny
Copy link

manovotny commented Jan 17, 2021

I had the same issue and adding always-auth and registry-url worked for me, as suggested in this other issue / comment.

- name: Set node version
  uses: actions/setup-node@v1
  with:
      always-auth: true
      node-version: 12.14.0
      registry-url: 'https://npm.pkg.github.com'

@baptisteArno
Copy link

Still not working the same error...

Here is my complete workflow:

on:
  push:
    tags:
      - 'v*.*.*'

jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
      - run: yarn
      - run: yarn test

  publish-npm:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          node-version: 12
          registry-url: https://registry.npmjs.org/
      - run: yarn publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

  publish-gpr:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v1
        with:
          always-auth: true
          node-version: 12
          registry-url: https://npm.pkg.github.com/
      - run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" > ~/.npmrc
      - run: yarn publish
        env:
          NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

@BryanCrotaz
Copy link

I'm seeing the same problem with registry.npmjs.org

@Untanky
Copy link

Untanky commented Mar 19, 2021

I got it working for me.

I had not set the publishConfig.registry in my package.json. With that set it works perfectly.

@dmitry-shibanov
Copy link
Contributor

Hello everyone. Thank you for all your response. I could reproduce the issue. I think the issue is more relevant to yarn itself. I found some similar issues:

@orihomie
Copy link

@Untanky 's solution worked for me, thanks!

@dmitry-shibanov dmitry-shibanov added the bug Something isn't working label Dec 13, 2021
@dmitry-shibanov
Copy link
Contributor

Hello everyone. Thank you for your responses. For now I'm going to close the issue, because the root cause of the issue does not come from the setup-node action. If you have any concerns feel free to ping us.

deining pushed a commit to deining/setup-node that referenced this issue Nov 9, 2023
* docs: update README.md [skip ci]

* docs: update .all-contributorsrc [skip ci]

Co-authored-by: allcontributors[bot] <46447321+allcontributors[bot]@users.noreply.github.com>
hyochan added a commit to dooboolab-community/dooboo-ui that referenced this issue Feb 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

8 participants
@manovotny @BryanCrotaz @AjayPoshak @baptisteArno @Untanky @dmitry-shibanov @orihomie and others