Score:0

Azure Devops Pipeline Trigger based on branch

it flag

My yaml pipeline is working fine which perform terraform install, init, validate, plan and apply if the changes are commit to main branch.

Here, i am trying to execute the terraform apply only if the commit happens in main branch, tried to set pipeline trigger but failed

Willing to implement PR stuff.

trigger:
  batch: true
  branches:
    include:
      - main
      - feature/*
pool:
  vmImage: 'vm'

stages:
- stage: TerraformPipeline
  jobs:
    - job: AKSDeploymentViaTerraform
      continueOnError: false
      steps:
      - task: PublishPipelineArtifact@1
        displayName: Publish Artifacts
        
      - task: TerraformInstaller@0
        displayName: Terraform Install
        
      - task: TerraformCLI@0
        displayName: Terraform Init
        
      - task: TerraformCLI@0
        displayName: Terraform Validate 
        
      - task: TerraformCLI@0
        displayName: Terraform Plan
        
      - task: TerraformCLI@0
        displayName: Terraform Apply
~~~
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.