Skip publishing on Build.Reason === PullRequest

master
Futago-za Ryuu 6 years ago
parent 56f3c98579
commit 30f3260008

@ -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'])

@ -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 );

Loading…
Cancel
Save