From a61845cae3e32f50f69a751f9780612b72aa7757 Mon Sep 17 00:00:00 2001 From: Carlos Almeida Date: Sun, 19 Jul 2026 16:00:04 -0600 Subject: [PATCH 1/2] fix(ci): anchor native-change detection to package.json's version, not the latest tag MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The v3.16.0 release attempt tagged the release but failed its pre-publish benchmark gate (#2127) before publish ran, so package.json on main is still 3.15.0 and nothing was actually published under that tag. detect-changes picked the dangling v3.16.0 tag as "last published release" and diffed it against itself, finding no native-relevant changes and skipping the fresh native build — causing every PR's Engine-parity/Test jobs to fall back to the real published 3.15.0 binary, which is 56 native-relevant files behind HEAD. Anchoring to package.json's declared version instead of "the most recent semver-shaped tag" ties the check to what's actually checked out. --- .github/workflows/ci.yml | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 27d320fc..d15b83c2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -72,11 +72,21 @@ jobs: # nothing about whether the published binary this job's skip relies # on has already drifted from HEAD. The only baseline that actually # answers "is the published fallback binary still trustworthy" is - # the last release tag. - LAST_TAG=$(git tag --sort=-version:refname --list 'v[0-9]*.[0-9]*.[0-9]*' | grep -v dev | head -1) - - if [ -z "$LAST_TAG" ] || ! git cat-file -e "$LAST_TAG" 2>/dev/null; then - echo "No usable release tag to diff against — assuming native changed" + # the tag for the version package.json currently declares. + # + # This deliberately does NOT use "the most recent vX.Y.Z tag" — + # a release tag is created by the GitHub Release that kicks off + # publish.yml, but publish itself (and the package.json version + # bump that comes with it) can still fail afterwards, e.g. the + # pre-publish benchmark gate. That leaves a tag on origin with no + # matching publish, which made this job wrongly report "unchanged" + # against a fallback binary that was actually several releases + # stale (#2127). + CURRENT_VERSION=$(grep -m1 '"version"' package.json | sed -E 's/.*: *"([^"]*)".*/\1/') + LAST_TAG="v$CURRENT_VERSION" + + if [ -z "$CURRENT_VERSION" ] || ! git cat-file -e "$LAST_TAG" 2>/dev/null; then + echo "No usable release tag ($LAST_TAG) to diff against — assuming native changed" echo "native_changed=true" >> "$GITHUB_OUTPUT" exit 0 fi From 45eadb4906ad0911db98525f6aa1158eaab8877d Mon Sep 17 00:00:00 2001 From: Carlos Almeida Date: Sun, 19 Jul 2026 18:27:42 -0600 Subject: [PATCH 2/2] fix: parse package.json version via node -p instead of grep/sed (#2128) --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d15b83c2..c32d6c1d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -82,7 +82,7 @@ jobs: # matching publish, which made this job wrongly report "unchanged" # against a fallback binary that was actually several releases # stale (#2127). - CURRENT_VERSION=$(grep -m1 '"version"' package.json | sed -E 's/.*: *"([^"]*)".*/\1/') + CURRENT_VERSION=$(node -p "require('./package.json').version") LAST_TAG="v$CURRENT_VERSION" if [ -z "$CURRENT_VERSION" ] || ! git cat-file -e "$LAST_TAG" 2>/dev/null; then