diff --git a/azure-pipelines.yml b/azure-pipelines.yml index dc3ed2f..e5c023b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -55,4 +55,4 @@ jobs: displayName: 'Publish to NPM' env: NPM_TOKEN: $(NPM_CI_TOKEN) - PR_BRANCH: $[ coalesce(variables['System.PullRequest.SourceBranch'], 'not-found') ] + BUILD_REASON: $(variables['Build.Reason']) diff --git a/tools/publish-dev/index.js b/tools/publish-dev/index.js index 1c93f65..7f8111a 100644 --- a/tools/publish-dev/index.js +++ b/tools/publish-dev/index.js @@ -18,9 +18,9 @@ const VERSION = require( packagejson ).version; const { + BUILD_REASON, GIT_BRANCH, NPM_TOKEN, - PR_BRANCH, } = process.env; @@ -54,7 +54,7 @@ function exec( command, print = true ) { // assertions -if ( PR_BRANCH !== "not-found" ) { +if ( BUILD_REASON && BUILD_REASON === "PullRequest" ) { console.log( "Skipping publish, PR's are not published." ); process.exit( 0 );