Skip to content

Commit bbdfbf8

Browse files
committed
Prevent unintended Azure pipeline runs
By default, if an Azure pipeline does not define a `pr` attribute, Azure takes the default behavior of running the pipeline for *every* pull request. Similarly, if the `trigger` attribute is not defined, the pipeline runs for push commits on *every* branch in the repo. It is possible to change this default behavior on the Azure side: https://learn.microsoft.com/en-us/azure/devops/release-notes/2023/sprint-227-update#prevent-unintended-pipeline-runs However, since these pipelines are only ever meant to be executed on specific events, we can change the default behavior by setting the `pr` and the `trigger` attributes to `none` where they weren't previously defined. Ref: https://issues.redhat.com/browse/RHTAP-5246 Signed-off-by: Luiz Carvalho <[email protected]>
1 parent 72eecdf commit bbdfbf8

File tree

4 files changed

+8
-0
lines changed

4 files changed

+8
-0
lines changed

generated/gitops-template/azure/azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
pr:
44
- main
55

6+
trigger: none
7+
68
# Using self-hosted 'Default' agent pool by default
79
# Change accordingly when using a different agent pool
810
# Can be deleted if self-hosted agents are not being used

generated/source-repo/azure/azure-pipelines.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated from templates/source-repo/azure-pipelines.yml.njk. Do not edit directly.
22

3+
pr: none
4+
35
trigger:
46
- main
57

templates/gitops-template/azure-pipelines.yml.njk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
pr:
55
- main
66

7+
trigger: none
8+
79
# Using self-hosted 'Default' agent pool by default
810
# Change accordingly when using a different agent pool
911
# Can be deleted if self-hosted agents are not being used

templates/source-repo/azure-pipelines.yml.njk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
{%- include "do-not-edit.njk" -%}
22
{%- set secrets = build_secrets -%}
33

4+
pr: none
5+
46
trigger:
57
- main
68

0 commit comments

Comments
 (0)