Using branch "exclude" seems to be ignored

My set-up is as follows:

- name: step1
  when:
    branch:
      - epic/*
- name: step2
  when:
    branch:
      exclude:
        - epic/*
- name: step3
  when:
    branch:
      - epic/*
...

trigger:
  event:
    - pull_request

When I push to a new branch named epic/test-branch the exact opposite of what I expect happens. Step2 runs and step1 and step3 do not.

Any help

Fascinating,

If I run with the trigger set to push it works as normal. When running with pull_request it does the opposite

@bradrydzewski I think this is a bug

I am unable to reproduce the issue.

Here is my test yaml:
https://cloud.drone.io/drone/hello-world/285

And here are the test results:
https://cloud.drone.io/drone/hello-world/285

In terms of pull requests, please keep in mind that drone evaluates conditions against the target branch, not the source branch.

In terms of pull requests, please keep in mind that drone evaluates conditions against the target branch, not the source branch.

Please can you specify a bit more context of what you mean here?

Ah wait, I get you.

Do you not think that creates a lot of confusion? My understanding when I specify branch conditions is that I want to evaluate the source branch. For the majority of people, pull requests are made against a single branch, but they have many names (feature/, bug/). I would want to run Jobs A, B, C on a feature/* and D, E, F on a bug/*. Both are going into develop branch. With this set up how do I differentiate?