File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6060 npm_status=$?
6161 set -e
6262 if [ "$npm_status" -eq 0 ]; then
63- PACKAGE_NAME="$package_name" PACKAGE_VERSION="$package_version" PUBLISHED_METADATA="$npm_output" node -e 'const value = JSON.parse(process.env.PUBLISHED_METADATA); const integrity = value["dist.integrity"] ?? value.dist?.integrity; if (value.name !== process.env.PACKAGE_NAME || value.version !== process.env.PACKAGE_VERSION || typeof integrity !== "string") throw new Error("Published npm metadata does not match the release package")'
63+ PACKAGE_NAME="$package_name" PACKAGE_VERSION="$package_version" PUBLISHED_METADATA="$npm_output" node -e 'const parsed = JSON.parse(process.env.PUBLISHED_METADATA); const value = Array.isArray(parsed) ? parsed[0] : parsed; const integrity = value?. ["dist.integrity"] ?? value? .dist?.integrity; if (value? .name !== process.env.PACKAGE_NAME || value? .version !== process.env.PACKAGE_VERSION || typeof integrity !== "string") throw new Error("Published npm metadata does not match the release package")'
6464 echo "exists=true" >> "$GITHUB_OUTPUT"
6565 echo "Verified ${package_name}@${package_version}; npm publication will be skipped."
6666 elif grep -q "E404" <<<"$npm_output"; then
You can’t perform that action at this time.
0 commit comments