Skip to content

Commit 17d86d0

Browse files
committed
Fix npm publish script to read tag from updated nx.json path with error handling
1 parent e81fd1b commit 17d86d0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.ado/jobs/npm-publish.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ jobs:
2424
- template: /.ado/templates/configure-git.yml@self
2525

2626
- script: |
27-
PUBLISH_TAG=$(jq -r '.release.version.generatorOptions.currentVersionResolverMetadata.tag' nx.json)
27+
PUBLISH_TAG=$(jq -r '.release.version.versionActionsOptions.currentVersionResolverMetadata.tag' nx.json)
28+
if [ -z "$PUBLISH_TAG" ] || [ "$PUBLISH_TAG" = "null" ]; then
29+
echo "Error: Failed to read publish tag from nx.json"
30+
exit 1
31+
fi
2832
echo "##vso[task.setvariable variable=publishTag]$PUBLISH_TAG"
2933
echo "Using publish tag from nx.json: $PUBLISH_TAG"
3034
displayName: Read publish tag from nx.json

0 commit comments

Comments
 (0)