From 64bf8345ace42295c4533a77d3b48d0e8457fd33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJamesHenry=E2=80=9D?= Date: Mon, 10 Jun 2024 21:16:08 +0400 Subject: [PATCH] fix(release): false positive npm dist-tag add --- .../src/executors/release-publish/release-publish.impl.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/js/src/executors/release-publish/release-publish.impl.ts b/packages/js/src/executors/release-publish/release-publish.impl.ts index a15f813b9a715..91c3b08b38109 100644 --- a/packages/js/src/executors/release-publish/release-publish.impl.ts +++ b/packages/js/src/executors/release-publish/release-publish.impl.ts @@ -110,7 +110,12 @@ export default async function runExecutor( }; } - if (resultJson.versions.includes(currentVersion)) { + // If only one version of a package exists in the registry, versions will be a string instead of an array. + const versions = Array.isArray(resultJson.versions) + ? resultJson.versions + : [resultJson.versions]; + + if (versions.includes(currentVersion)) { try { if (!isDryRun) { execSync(npmDistTagAddCommandSegments.join(' '), {