From 5511c6ec4cc96b350d99812f3263b442e78f3563 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:19:38 +0100 Subject: [PATCH 1/7] Added test task with test condition. Negative test --- azure-pipelines.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3e927fdaa..6f59fb639 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -83,6 +83,9 @@ jobs: env: NPM_TOKEN: $(npmPublishToken) + - bash: | + echo test + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'users/roman-shchukin/pipeline_publish_condition_fixing')) ################################################# - job: macOS ################################################# From e5c3935c0f1080f48ac67adfab6e0b01bf606649 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:24:30 +0100 Subject: [PATCH 2/7] Added test task with test condition. Positive test --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 6f59fb639..181331e8b 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,7 +85,7 @@ jobs: - bash: | echo test - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'users/roman-shchukin/pipeline_publish_condition_fixing')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'refs/head/users/roman-shchukin/pipeline_publish_condition_fixing')) ################################################# - job: macOS ################################################# From e7539574d45b57b0fdbebe8150ac9dd501d7e649 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:25:49 +0100 Subject: [PATCH 3/7] Fix path --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 181331e8b..bf2c72748 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,7 +85,7 @@ jobs: - bash: | echo test - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'refs/head/users/roman-shchukin/pipeline_publish_condition_fixing')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'refs/heads/users/roman-shchukin/pipeline_publish_condition_fixing')) ################################################# - job: macOS ################################################# From 81752b7f11b2dd675241ed062161c1a5ec7a2710 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:32:16 +0100 Subject: [PATCH 4/7] Fix path --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf2c72748..0eb387a40 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -85,7 +85,7 @@ jobs: - bash: | echo test - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'refs/heads/users/roman-shchukin/pipeline_publish_condition_fixing')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'pipeline_publish_condition_fixing')) ################################################# - job: macOS ################################################# From 3c6ba2c4cc2fd3bab3ff3033f263fc281b13a83f Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:36:24 +0100 Subject: [PATCH 5/7] Fix path --- azure-pipelines.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 0eb387a40..f6f118d96 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,13 +79,10 @@ jobs: npm publish || true # Ignore publish failures, usually will happen because package already exists displayName: (azure-pipelines-task-lib) npm publish workingDirectory: node - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'master', 'releases/4.x')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'master', '4.x')) env: NPM_TOKEN: $(npmPublishToken) - - bash: | - echo test - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'pipeline_publish_condition_fixing')) ################################################# - job: macOS ################################################# From 530b6ae2949f6d244c6e10b72330ea067528f777 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:50:53 +0100 Subject: [PATCH 6/7] Changed build.sourcebranchname -> build.sourcebranch and path to branch --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f6f118d96..8b18e87cc 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ jobs: npm publish || true # Ignore publish failures, usually will happen because package already exists displayName: (azure-pipelines-task-lib) npm publish workingDirectory: node - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranchname'], 'master', '4.x')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master', 'refs/heads/4.x')) env: NPM_TOKEN: $(npmPublishToken) From c2a603f4ef1a6d7177bf00d3251a0aa9eba57f20 Mon Sep 17 00:00:00 2001 From: Roman Shchukin Date: Thu, 10 Nov 2022 14:51:55 +0100 Subject: [PATCH 7/7] Fix path --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8b18e87cc..5a2d2450c 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -79,7 +79,7 @@ jobs: npm publish || true # Ignore publish failures, usually will happen because package already exists displayName: (azure-pipelines-task-lib) npm publish workingDirectory: node - condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master', 'refs/heads/4.x')) + condition: and(succeeded(), in(variables['build.reason'], 'IndividualCI', 'BatchedCI', 'Manual'), in(variables['build.sourcebranch'], 'refs/heads/master', 'refs/heads/releases/4.x')) env: NPM_TOKEN: $(npmPublishToken)