# Set 2 separate triggers for 1 pipeline

**URL:** <https://drone.discourse.group/t/set-2-separate-triggers-for-1-pipeline/8391>\
**Category:** Drone Support\
**Created:** [November 22, 2021, 1:56pm UTC](https://drone.discourse.group/t/set-2-separate-triggers-for-1-pipeline/8391 "2021-11-22T13:56:02Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alena](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/alena/32/2308_2.png) [@Alena](https://drone.discourse.group/u/Alena)\
**Post date:** [November 22, 2021, 1:56pm UTC](https://drone.discourse.group/t/set-2-separate-triggers-for-1-pipeline/8391/1 "2021-11-22T13:56:02Z")

</div>

I have a pipeline and 2 conditions when I want to run it: 1.cron job, 2.push to some repo

condition 1:

```auto
event:
- cron
cron:
- nightly

```

condition 2:

```auto
  repo:
  - repo-name
  branch:
  - master
  event:
  - push

```

Could you please tell me if I can have one pipeline with these 2 triggers at the same time? (trigger if: condition1 OR condition2)

I’ve checked this doc ([Triggers | Drone](https://docs.drone.io/pipeline/docker/syntax/trigger/)), however I’m confused by this phrase:  
`You can also combine multiple triggers. Note that all triggers must evaluate to true when combining multiple triggers.`  
does it mean that OR between 2 different conditions is not possible?

---

<div class="post-metadata">

**Author:** ![phil-davis](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/phil-davis/32/6019_2.png) [@phil-davis](https://drone.discourse.group/u/phil-davis)\
**Post date:** [August 29, 2022, 6:52am UTC](https://drone.discourse.group/t/set-2-separate-triggers-for-1-pipeline/8391/2 "2022-08-29T06:52:44Z")

</div>

I have a similar need. I want to trigger a pipeline on:

1. push to master

```auto
trigger:
  branch:
  - master
  event:
  - push

```

and also on:  
2) pull to a branch with a name that starts with “release”, something like:

```auto
trigger:
  branch:
  - release*
  event:
  - pull

```

But if I write:

```auto
trigger:
  branch:
  - master
  - release*
  event:
  - push
  - pull

```

then the pipeline will run in more situations than I want.

How do we write a list of “combinations” of situations in which a pipeline should be executed?

---

<div class="post-metadata">

**Author:** ![phil-davis](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/phil-davis/32/6019_2.png) [@phil-davis](https://drone.discourse.group/u/phil-davis)\
**Post date:** [August 29, 2022, 11:35am UTC](https://drone.discourse.group/t/set-2-separate-triggers-for-1-pipeline/8391/3 "2022-08-29T11:35:24Z")

</div>

Note: this kind of thing can sometimes be achieved by writing 2 “copies” of the pipeline. Give each copy mutually-exclusive sets of trigger conditions, so that both pipelines never both trigger in the same build. But one or the other will trigger when one of the sets of trigger conditions evaluates to true. That lets you write “independent” sets of trigger conditions.

See [[tests-only] [full-ci] Adjust triggers for chat-notifications pipeline by phil-davis · Pull Request #4471 · owncloud/ocis · GitHub](https://github.com/owncloud/ocis/pull/4471) for example. (But I had a separate challenge with that, because I want something to trigger on “pull\_request” from a branch like “release\*”. But when drone processes a “pull\_request” event it evaluates the branch the target branch of the pull request, not the source branch. So I am also thinking about that!
