Skip to content

Commit bb36944

Browse files
authored
Merge pull request #10 from Receiptprotocol/codex/fix-npm12-array-metadata
Handle npm 12 array metadata
2 parents 1fc07a4 + 311130a commit bb36944

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
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

0 commit comments

Comments
 (0)