Drone exec does not simulate pull requests correctly

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:

      - pull_request

And the second one has the following trigger:

    - pull_request

I tried running the following command:

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.

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.

drone exec --pipeline=<name>

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!