From 306f04a90a2520c97a4411f3be111bd4a749fef0 Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 4 Jun 2026 09:54:01 -0700 Subject: [PATCH] [actions] nodejs.org PR: fix `force` boolean and grab the latest tag on dispatch The branch-reset step sent `force` as a string via `gh api -f "force=true"`, which the Git refs API rejects ("not a boolean", HTTP 422), failing the release run. Use `-F` so it is sent as a boolean. Also resolve the version from the latest `vX.Y.Z` tag (via the tags API) rather than `releases/latest`, so a manual `workflow_dispatch` with no input works even before the GitHub release object for a freshly pushed tag is published. --- .github/workflows/nodejs-org.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nodejs-org.yml b/.github/workflows/nodejs-org.yml index f3b58ebd..a1491534 100644 --- a/.github/workflows/nodejs-org.yml +++ b/.github/workflows/nodejs-org.yml @@ -7,7 +7,7 @@ on: workflow_dispatch: inputs: version: - description: 'nvm version tag (e.g., v0.40.4). Defaults to latest release.' + description: 'nvm version tag (e.g., v0.40.4). Defaults to the latest version tag.' required: false default: '' @@ -41,7 +41,8 @@ jobs: elif [ "${GITHUB_REF_TYPE}" = "tag" ]; then TAG="${GITHUB_REF#refs/tags/}" else - TAG="$(gh api "repos/${GITHUB_REPOSITORY}/releases/latest" --jq '.tag_name')" + TAG="$(gh api --paginate "repos/${GITHUB_REPOSITORY}/tags" --jq '.[].name' \ + | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n 1)" fi if ! printf '%s\n' "${TAG}" | grep -qE '^v[0-9]+\.[0-9]+\.[0-9]+$'; then @@ -74,7 +75,7 @@ jobs: gh api "repos/${FORK_OWNER}/nodejs.org/git/refs/heads/${BRANCH}" \ -X PATCH \ -f "sha=${UPSTREAM_SHA}" \ - -f "force=true" > /dev/null + -F "force=true" > /dev/null fi printf 'fork_owner=%s\n' "${FORK_OWNER}" >> "${GITHUB_OUTPUT}"