# Drone exec with pipeline trigger is running when it shouldn't

**URL:** <https://drone.discourse.group/t/drone-exec-with-pipeline-trigger-is-running-when-it-shouldnt/8184>\
**Category:** Drone Support\
**Created:** [June 17, 2020, 1:43am UTC](https://drone.discourse.group/t/drone-exec-with-pipeline-trigger-is-running-when-it-shouldnt/8184 "2020-06-17T01:43:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mildebrandt](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/mildebrandt/32/5297_2.png) [@mildebrandt](https://drone.discourse.group/u/mildebrandt)\
**Post date:** [June 17, 2020, 1:43am UTC](https://drone.discourse.group/t/drone-exec-with-pipeline-trigger-is-running-when-it-shouldnt/8184/1 "2020-06-17T01:43:10Z")

</div>

Hi! I have a multi-pipeline build with triggers on events. No matter what event I pass into `drone exec`, the first pipeline always gets called.

I’m guessing this is a side-effect of only running one pipeline at a time in the `exec` command. However, I would expect the triggers to still be respected.

Here’s my .drone.yml file:

```auto
kind: pipeline
name: Triggered on push
steps:
  - name: build
    image: busybox
    commands:
      - echo push
trigger:
  event:
    - push

---

kind: pipeline
name: Triggered on tag
steps:
  - name: build
    image: busybox
    commands:
      - echo tag
trigger:
  event:
    - tag

```

And my output:

```auto
$ drone exec --event tag
[build:0] + echo push
[build:1] push

```

Thoughts? Thanks.

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [June 17, 2020, 2:20am UTC](https://drone.discourse.group/t/drone-exec-with-pipeline-trigger-is-running-when-it-shouldnt/8184/2 "2020-06-17T02:20:59Z")

</div>

The `trigger` section is only evaluated when the pipeline is executed from a webhook. When executing from the command line using `drone exec` the first pipeline in the configuration file is executed by default. You can alternatively execute a specific named pipeline like this:

```nohighlight
drone exec --pipeline="Triggered on tag"

```

---

<div class="post-metadata">

**Author:** ![mildebrandt](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/mildebrandt/32/5297_2.png) [@mildebrandt](https://drone.discourse.group/u/mildebrandt)\
**Post date:** [June 17, 2020, 3:10am UTC](https://drone.discourse.group/t/drone-exec-with-pipeline-trigger-is-running-when-it-shouldnt/8184/3 "2020-06-17T03:10:05Z")

</div>

Thanks for the quick reply.
