Drone exec and triggers

Hello, using drone exec I’m trying to control the pipeline to be executed using Triggers.

But it appears whatever is set to --branch (e.g.: $ drone exec --branch=foo) the following .drone.yml execute its unique pipeline.

kind: pipeline
type: docker
name: ta

- name: test
  image: alpine
  - env

  - master

Conditions do respond as expected to the drone exec --branch option.

this is expected because the drone exec command ignores triggers. If you do not want to trigger a pipeline execution with drone exec then do not run drone exec :slight_smile:

I guess the source of confusion is because running drone exec implicitly means drone exec --pipeline default which will always run the first pipeline available.

So from a user perspective it sort of makes sense to think that if they are not explicitly declaring a pipeline, it’s up to drone to evaluate if should be run based on the other attributes.

Additionally, we kind of have a false positive when the docs mention:

You can also combine multiple triggers. Note that all triggers must evaluate to true when combining multiple triggers.

  event: [tag]
  branch: [master]

So in theory, by observing the above, if you run drone exec --pipeline default --branch falsy --event promote, since neither branch falsy evaluates to true when compared to branch master and the event is promote instead of tag, the assumption would naturally be that the command should simply exit without performing any actions.