Browse Source

Skip publishing on Build.Reason === PullRequest

master
Futago-za Ryuu 2 years ago
parent
commit
30f3260008
  1. 2
      azure-pipelines.yml
  2. 4
      tools/publish-dev/index.js

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

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

Loading…
Cancel
Save