fix: handle missing `latest` tag during version check by mcous · Pull Request #90 · JS-DevTools/npm-publish · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

fix: handle missing latest tag during version check #90

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

Merged
merged 8 commits into from
May 1, 2023

Conversation

mcous
Copy link
Member

@mcous mcous commented Apr 29, 2023

Overview

This PR makes two changes to how the calls to npm view and npm publish are made:

  1. If npm view package-name comes back empty due to [BUG] npm view package@latest exits with code 0 and no output if latest tag does not exist npm/cli#6408, we will now retry with npm view package-name@tag, to try to get some information
  2. If npm publish fails because the requested version already exists, the action will not fail.

Fixes #89

Change details

  • Restructured how the npmPublish function is broken up to delegate to a new compareAndPublish function
    • This change means only one temporary .npmrc file is created, rather than two
  • Renamed and reorganized some things for consistency

@mcous mcous changed the title Handle missing latest tag during version check fix: handle missing latest tag during version check Apr 30, 2023
@mcous mcous marked this pull request as ready for review May 1, 2023 12:10
@mcous mcous merged commit 69c6427 into main May 1, 2023
@mcous mcous deleted the fix-no-latest-tag-89 branch May 1, 2023 20:03
@mcous mcous mentioned this pull request May 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version check fails if latest tag does not exist in registry
1 participant

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.