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.

[Question] When publishing, why are git tags pushed before prepublish hook?

See original GitHub issue

When I run lerna publish:

? Are you sure you want to publish these packages? Yes
lerna info execute Skipping GitHub releases
lerna info git Pushing tags...

However, my prepublish scripts run tests and they sometimes fail. But git tags are already pushed. Why is this behaviour? Should I put my testing elsewhere?

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

9reactions
nmccreadycommented, Jan 29, 2020

@FredyC #707, etc etc til the heat death of the universe

Can you please explain how exactly that issue marked above resolves this issue. This is seriously by far the worst caveat of lerna.

I would prefer if it wouldn’t push tags to the remote a successful publish. That way if there is a failure it is easier to back out and is more consistent to how npm operates already.

3reactions
Robbie-Cookcommented, Dec 31, 2020

It’s 2021 and this is still a problem. Damn.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Do git tags get pushed as well? - Stack Overflow
When fetching, you are interacting with a remote repository somebody has published, which means: the set of tags that exist there are all...
Read more >
Git - Tagging - Git SCM
There is currently no option to push only lightweight tags, but if you use git push <remote> --follow-tags only annotated tags will be...
Read more >
scripts - npm Docs
Runs on local npm install without any arguments. Runs AFTER prepublish , but BEFORE prepublishOnly. NOTE: If a package being installed through git...
Read more >
Step by step: Building and publishing an NPM Typescript ...
Postversion will run after the commit has been made. A perfect place for pushing the commit as well as the tag. "postversion" :...
Read more >
[PSA] Please, please, please tag your git repositories when ...
I'm pretty sure you would want to commit before publishing though. I also delay pushing the tag and changes just in the off...
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