Drone

How to add conditions to pipelines?

I have 3 pipelines: correctness, release and notify. I want the first one to be triggered only for pull requests, release for pushes to master, and notify after all of these. I have specified “when” conditions for all the pipelines:

kind: pipeline
name: correctness
clone:
  disable: true
when:
  event:
  - pull_request
  branch:
  - master

---

kind: pipeline
name: release
when:
  event:
  - push
  branch:
  - master

---

kind: pipeline
name: notify
when:
  event:
  - pull_request
  - push
  branch:
  - master

However, all of them are triggered on non-master branches. It was told in the documentation that in order to trigger, all of the conditions must be met. Am I missing something?

see https://docker-runner.docs.drone.io/configuration/trigger/

1 Like

Yes, this is the answer. Instead of when the trigger should be used, the syntax is the same.