Skip to content

feat: promote npm edge tag to latest when prerelease is promoted#61

Merged
AaronFeledy merged 1 commit intomainfrom
feature/promote-edge-on-edit
Feb 20, 2026
Merged

feat: promote npm edge tag to latest when prerelease is promoted#61
AaronFeledy merged 1 commit intomainfrom
feature/promote-edge-on-edit

Conversation

@AaronFeledy
Copy link
Member

@AaronFeledy AaronFeledy commented Feb 20, 2026

Problem

When a release is published as a prerelease, it gets tagged as edge on npm. Later, when the release is promoted to a full release in GitHub, the npm latest tag doesn't update because the workflow only triggered on published.

Solution

  • Added released to the release workflow trigger types
  • New lightweight promote job that only runs npm dist-tag add latest — no install, no lint, no tests, no re-publish
  • Only fires on the released event (when a prerelease is promoted to full release)
  • Existing deploy job is now explicitly gated to published events only (no behavior change)
  • Uses TAG_NAME env var instead of direct interpolation to prevent script injection

Flow

  1. Publish as prerelease → full pipeline runs, publishes with edge tag (unchanged)
  2. Promote release → uncheck prerelease → promote job runs, points latest to that version (~15s)

The dist-tag add command is idempotent, so if both published and released fire on a fresh non-prerelease publish, the redundant promote is harmless.


Note

Low Risk
Only CI workflow logic changes; the main risk is accidentally retagging npm latest on release events, but it’s limited to released/published gates and uses an idempotent dist-tag command.

Overview
The GitHub Actions release workflow now also triggers on release.released events and adds a lightweight promote job that runs npm dist-tag add ... latest using the release tag version, so promoting a prerelease updates npm’s latest tag without re-publishing.

The existing deploy publish pipeline is explicitly gated to release.published events to avoid running on promotions.

Written by Cursor Bugbot for commit 378ed4a. This will update automatically on new commits. Configure here.

Adds a 'released' trigger to the release workflow with a lightweight 'promote' job that runs npm dist-tag to move 'latest' to the current version when a prerelease is promoted to a full release. The existing publish pipeline remains gated to 'published' events only.
@netlify
Copy link

netlify bot commented Feb 20, 2026

Deploy Preview for lando-python failed. Why did it fail? →

Name Link
🔨 Latest commit 378ed4a
🔍 Latest deploy log https://app.netlify.com/projects/lando-python/deploys/6997dc9c049bbd0008f2d39e

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is ON. A Cloud Agent has been kicked off to fix the reported issue.

echo "::notice title=Promoted $VERSION to latest::The latest tag now points to $VERSION (was edge-only)"
env:
TAG_NAME: ${{ github.event.release.tag_name }}
NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Race condition: promote fails before deploy publishes package

Medium Severity

When a non-prerelease release is published directly, GitHub fires both published and released as separate webhook deliveries, creating two concurrent workflow runs. The promote job (~15 seconds) will almost certainly attempt npm dist-tag add before the deploy job (several minutes of install, lint, test, then publish) has actually published the version to npm, causing promote to fail with a "version not found" error. The PR description calls this "harmless" assuming idempotency, but npm dist-tag add requires the version to already exist on the registry.

Additional Locations (1)

Fix in Cursor Fix in Web

@AaronFeledy AaronFeledy merged commit fbd6a57 into main Feb 20, 2026
8 of 12 checks passed
@AaronFeledy AaronFeledy deleted the feature/promote-edge-on-edit branch February 20, 2026 04:36
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.

1 participant