question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to publish on CI

See original GitHub issue

Expected Behavior

  • I should be able to publish through Travis CI

Current Behavior

  • Authentication Error

Possible Solution

  • Use GH_TOKEN

Steps to Reproduce (for bugs)

  1. Sample Build URL: https://travis-ci.com/action-land/action-land/builds/117467520
  2. Error:

lerna info git Pushing tags...
lerna ERR! Error: Command failed: git push --follow-tags --no-verify origin master
lerna ERR! remote: Invalid username or password.
lerna ERR! fatal: Authentication failed for 'https://github.com/action-land/action-land.git/'
lerna ERR! 
lerna ERR!     at makeError (/home/travis/build/action-land/action-land/node_modules/execa/index.js:174:9)
lerna ERR!     at /home/travis/build/action-land/action-land/node_modules/execa/index.js:278:16
lerna ERR! Error: Command failed: git push --follow-tags --no-verify origin master
lerna ERR! remote: Invalid username or password.
lerna ERR! fatal: Authentication failed for 'https://github.com/action-land/action-land.git/'
lerna ERR! 
lerna ERR!     at makeError (/home/travis/build/action-land/action-land/node_modules/execa/index.js:174:9)
lerna ERR!     at /home/travis/build/action-land/action-land/node_modules/execa/index.js:278:16
lerna ERR! lerna Command failed: git push --follow-tags --no-verify origin master
lerna ERR! lerna remote: Invalid username or password.
lerna ERR! lerna fatal: Authentication failed for 'https://github.com/action-land/action-land.git/'
lerna ERR! lerna 
lerna.json

{
  "lerna": "2.11.0",
  "packages": [
    "modules/*"
  ],
  "version": "4.2.0",
  "npmClient": "yarn",
  "useWorkspaces": true
}

Context

Trying to publish a mono repo via Travis

Your Environment

Executable Version
lerna --version 3.15.0
npm --version 6.4.1
yarn --version 1.16.0
node --version v12.2.0
OS Version
macOS Mojave 10.14.5

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
jenniferphamcommented, Jul 13, 2020

I was able to get my CI to work and publish through Github Actions. Even if you’re not using Github Actions, maybe this could give you an idea of what to do. I added SSH-key and Github token which had write access to the repo.

    steps:
      - name: Copy repo code
        uses: actions/checkout@v2
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}

     - name: Configure git credentials
        uses: OleksiyRudenko/gha-git-credentials@v1
        with:
          token: ${{ secrets.GITHUB_TOKEN }}

      - name: Publish New Version and Release
        env:
          NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
          GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
        run: |
          lerna publish --yes
4reactions
evocateurcommented, Jul 16, 2019

I really don’t recommend generating git commits in CI. If you’re unwilling to split versioning and publishing entirely (only running lerna publish from-git --yes in CI), then I guess you need to enable the Travis host to push commits back to Github (which is outside the scope of lerna).

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failing pipeline job with package publishing with "Name is ...
Failing pipeline job with package publishing Using the same file .gitlab-ci.yml does not work for some repositories while for other it does.
Read more >
Unable to publish dev version of orb - CircleCI Discuss
The orb-tools/publish-dev job in our pipeline is failing with the message Error: Unable to publish orb: Non-nullable field was null.
Read more >
Troubleshoot CI-CD, Azure DevOps, and GitHub issues
Cannot publish because of 4-MB ARM template limit. Issue. You can't deploy because you hit Azure Resource Manager limit of 4-MB total template ......
Read more >
Angular project CI in azure devops giving error 'Publishing ...
I was applying CI/CD in one of my project which hosted in GitHub. ... ##[error]Publishing build artifacts failed with an error: Not found...
Read more >
[error]Publishing build artifacts failed with an error: Not found ...
To solve this problem, you need to check whether the Path to publish in your Publish build artifacts task is consistent with the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found