# Can we add complex logic in the pipeline trigger?

**URL:** <https://drone.discourse.group/t/can-we-add-complex-logic-in-the-pipeline-trigger/12641>\
**Category:** Drone Support\
**Tags:** pipeline, yaml\
**Created:** [October 14, 2022, 6:54am UTC](https://drone.discourse.group/t/can-we-add-complex-logic-in-the-pipeline-trigger/12641 "2022-10-14T06:54:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kiran](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/kiran/32/7864_2.png) [@kiran](https://drone.discourse.group/u/kiran)\
**Post date:** [October 14, 2022, 6:54am UTC](https://drone.discourse.group/t/can-we-add-complex-logic-in-the-pipeline-trigger/12641/1 "2022-10-14T06:54:29Z")

</div>

If a pipeline needs complex trigger logic like:

```auto
"refs/pull/**" && "refs/heads/release*"

```

Can we do this in the drone configuration? See more context at [CI: duplicate CI run with only chat notification · Issue #4460 · owncloud/ocis · GitHub](https://github.com/owncloud/ocis/issues/4460)?

Note: The `starlark` language is used to generate the `yaml` config file.

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![d1wilko](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/d1wilko/32/6474_2.png) [@d1wilko](https://drone.discourse.group/u/d1wilko)\
**Post date:** [October 18, 2022, 12:34pm UTC](https://drone.discourse.group/t/can-we-add-complex-logic-in-the-pipeline-trigger/12641/2 "2022-10-18T12:34:32Z")

</div>

Hey @kiran the logic you are looking for should be here - [Triggers | Drone](https://docs.drone.io/pipeline/docker/syntax/trigger/)

I think a commit can only have one ref so I’m not sure your logic would work - instead you could make use of [refs](https://docs.drone.io/pipeline/docker/syntax/trigger/#by-reference) and [actions](https://docs.drone.io/pipeline/docker/syntax/trigger/#by-action)

Or maybe use [branch](https://docs.drone.io/pipeline/docker/syntax/trigger/#by-branch) or [target](https://docs.drone.io/pipeline/docker/syntax/trigger/#by-target)
