fix: Publish stage always skipped due to boolean expression mismatch in publish pipeline#4093
Merged
Saadnajmi merged 1 commit intomicrosoft:mainfrom Apr 24, 2026
Conversation
dannyvv
approved these changes
Apr 24, 2026
…ression mismatch
The condition `not(${{ parameters.skipNpmPublish }})` mixes compile-time
template expansion with runtime expression evaluation. At compile time,
${{ parameters.skipNpmPublish }} expands to the YAML boolean string 'False'
(capital F). In the Azure DevOps runtime expression context, 'False' is not
the boolean keyword false — it is a non-empty string, which is always truthy.
So not(truthy) evaluates to false, causing the Publish stage to be skipped
regardless of the parameter value.
Fix: use ne('${{ parameters.skipNpmPublish }}', 'true') which correctly
compares the expanded string using case-insensitive string comparison.
baa56e1 to
fe8b19f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Publish to NPM stage in
azure-pipelines.publish.ymlis always skipped, even when there are tarballs andskipNpmPublishisfalse.Root Cause
The stage condition uses:
not(${{ parameters.skipNpmPublish }})This mixes compile-time template expansion (
${{ }}) with a runtime expression function (not()).At compile time,
${{ parameters.skipNpmPublish }}expands to the YAML boolean stringFalse(capital F). In Azure DevOps runtime expressions,Falseis not the boolean keywordfalse— it's a non-empty string, which is always truthy. Sonot(truthy)→false, and the entireand(...)short-circuits tofalse.This happens regardless of the parameter value — both
TrueandFalseare non-empty strings, both truthy, both negated tofalse.Fix
Replace
not(${{ parameters.skipNpmPublish }})with:ne('${{ parameters.skipNpmPublish }}', 'true')This uses
ne()(not-equal) with a string comparison. Azure DevOpsne()is case-insensitive for strings, so:false(default)ne('False', 'true')truene('True', 'true')