From 37fa101666f0169818925bdc1aea9cc3b4b93c2b Mon Sep 17 00:00:00 2001 From: Aaron Feledy Date: Thu, 19 Feb 2026 19:55:13 -0600 Subject: [PATCH 1/2] feat: promote npm edge tag to latest when release is edited Adds an 'edited' trigger to the release workflow with a lightweight 'promote' job that runs npm dist-tag to move 'latest' to the current version. Only fires when a prerelease is changed to a full release (not drafts). The existing publish pipeline remains gated to 'published' events only. --- .github/workflows/release.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d424fe57..b52c39e3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,9 +4,32 @@ on: release: types: - published + - edited jobs: + # When a prerelease is edited to a full release, just promote the npm tag + promote: + if: github.event.action == 'edited' && !github.event.release.prerelease && !github.event.release.draft + runs-on: ubuntu-24.04 + steps: + - name: Checkout code + uses: actions/checkout@v6 + - name: Install node 20 + uses: actions/setup-node@v6 + with: + node-version: '20' + registry-url: https://registry.npmjs.org + - name: Promote edge to latest + run: | + VERSION=$(node -p "require('./package.json').version") + PACKAGE=$(node -p "require('./package.json').name") + npm dist-tag add "$PACKAGE@$VERSION" latest + echo "::notice title=Promoted $VERSION to latest::The latest tag now points to $VERSION (was edge-only)" + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_DEPLOY_TOKEN}} + deploy: + if: github.event.action == 'published' runs-on: ${{ matrix.os }} env: TERM: xterm From 226ad07855dbbae21d0dddea15d4a385e40129e5 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Fri, 20 Feb 2026 02:02:59 +0000 Subject: [PATCH 2/2] Fix promote job to use release tag version instead of package.json The promote job now derives VERSION from github.event.release.tag_name instead of reading package.json. This ensures it points the 'latest' npm dist-tag to the correct prerelease version that was actually published, rather than the stale version in the tagged commit's package.json. --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b52c39e3..9dcb11d4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,7 +21,7 @@ jobs: registry-url: https://registry.npmjs.org - name: Promote edge to latest run: | - VERSION=$(node -p "require('./package.json').version") + VERSION=$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//') PACKAGE=$(node -p "require('./package.json').name") npm dist-tag add "$PACKAGE@$VERSION" latest echo "::notice title=Promoted $VERSION to latest::The latest tag now points to $VERSION (was edge-only)"