From 5d146925f6145bedb890b085fb5f787106a24eac Mon Sep 17 00:00:00 2001 From: Maxim Zaytsev Date: Wed, 28 Jun 2023 18:42:35 +0200 Subject: [PATCH] Fix condition (#360) --- azure-pipelines.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 5255139..8df8bff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,3 +1,7 @@ +trigger: + - master + - releases/* + variables: isMaster: $[eq(variables['Build.SourceBranch'], 'refs/heads/master')] isRelease: $[startsWith(variables['Build.SourceBranch'], 'refs/heads/releases')] @@ -11,6 +15,11 @@ parameters: type: object default: ['windows-latest', 'ubuntu-latest'] + - name: publishToNpm + displayName: Publish to npm + type: boolean + default: false + stages: - stage: Build displayName: Build typed-rest-client @@ -72,7 +81,7 @@ stages: displayName: npm run test - stage: Publish - condition: or(eq(variables.isRelease, true), eq(variables.isMaster, true)) + condition: and(succeeded(), or(eq('${{ parameters.publishToNpm }}', true), eq(variables.isRelease, true), eq(variables.isMaster, true))) jobs: - job: Publish_package displayName: Publish npm package @@ -92,4 +101,4 @@ stages: workingDir: '_build' publishRegistry: useExternalRegistry publishEndpoint: NPM-Automation-Token - continueOnError: true + continueOnError: true