# Drone exec does not simulate pull requests correctly

**URL:** <https://drone.discourse.group/t/drone-exec-does-not-simulate-pull-requests-correctly/8242>\
**Category:** Drone Support\
**Created:** [January 12, 2022, 10:54pm UTC](https://drone.discourse.group/t/drone-exec-does-not-simulate-pull-requests-correctly/8242 "2022-01-12T22:54:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmaze](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/djmaze/32/3788_2.png) [@djmaze](https://drone.discourse.group/u/djmaze)\
**Post date:** [January 12, 2022, 10:54pm UTC](https://drone.discourse.group/t/drone-exec-does-not-simulate-pull-requests-correctly/8242/1 "2022-01-12T22:54:53Z")

</div>

Up until the latest version of 1.5.0 of drone-cli, it seems not possible to trigger `pull_request` events.

I have a configuration with two pipelines. The first one has the following trigger:

```auto
trigger:
  event:
    exclude:
      - pull_request

```

And the second one has the following trigger:

```auto
trigger:
  event:
    - pull_request

```

I tried running the following command:

```bash
env DRONE_PULL_REQUEST=1 drone exec --event pull_request

```

This command triggers the first _as well as_ the second pipeline, which is wrong.

When pushing this configuration to the repo, drone server correctly executes the _second_ pipeline instead.

This behaviour seems to be broken. It would be really helpful if there was a reliable way to test pipelines before pushing them to the central repository.

---

<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:** [January 12, 2022, 11:28pm UTC](https://drone.discourse.group/t/drone-exec-does-not-simulate-pull-requests-correctly/8242/2 "2022-01-12T23:28:19Z")

</div>

It is by design that drone exec ignores the trigger section. If you want a specific pipeline to execute, or not execute, you should tell drone exec exactly which pipeline to run. This can be done using the --pipeline flag.

```nohighlight
drone exec --pipeline=<name>

```

---

<div class="post-metadata">

**Author:** ![djmaze](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/djmaze/32/3788_2.png) [@djmaze](https://drone.discourse.group/u/djmaze)\
**Post date:** [January 13, 2022, 12:22am UTC](https://drone.discourse.group/t/drone-exec-does-not-simulate-pull-requests-correctly/8242/3 "2022-01-13T00:22:47Z")

</div>

Thanks for the clarification.

I think this should be part of the documentation. (Or is it and I overlooked it?) So the developer knows which parts of the config can be tested locally and which not.

Either way, taking this opportunity to say thank you for the work you did on this awesome project!
