Skip to content

Starting builds automatically with codemagic.yaml #3100

Closed Answered by dtrdic
fikretsengul asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @fikretsengul, You're currently using the push event trigger, which causes workflows to run on any push — including direct pushes to the dev branch. That’s why you’re seeing unexpected builds.

In your case, I recommend using only pull_request events and enforcing conditions using the when: clause with attributes from the pull request webhook.

Here’s an example:

      triggering:
          events:
            - pull_request
          branch_patterns:
            - pattern: 'uat'
              include: true
              source: false
      when:
        condition:
           event.pull_request.head.ref == "dev"

With this setup:

  • A build will be triggered when a pull request is opened i…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by dtrdic
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
2 participants