0

I am able to generate build trigger url and able to call build operation via Gitlab Web hook.

But the build operation is calling in each commit irrespective of any branch. But I want to trigger build operation for a specific branch commit. Means want to execute build only if any code pushed to a specific branch.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Niladri_Android
  • 145
  • 1
  • 12

1 Answers1

0

In Gitlab yaml you can specify each job to trigger on certain branches or excluding branches

https://docs.gitlab.com/ee/ci/yaml/#only-and-except

job_name:
  script:
    - rake spec
    - coverage
  stage: test
  only:
    - master
  tags:
    - ruby
    - postgres
  allow_failure: true

The above yaml would only execute on master

danielc103
  • 1
  • 1
  • 2