Drone

"target" conditions can't use the exclude syntax

I only noticed this was not in the documentation (https://docs.drone.io/user-guide/pipeline/triggers/#by-target) after trying to use it, as I believed the “exclude” syntax in conditions worked across all keys, but the following does not work:

trigger:
  event:
  - promote
  target:
    exclude:
    - production

And will run a pipeline on any promote event, with no warnings about (for example) an unknown key in the yaml file. If there is a technical reason why the exclude syntax can’t work for the promote event, could we at least make drone error on this kind of exclude key, as it feels very misleading, with it working in all other cases I’ve tried!

target supports exclude syntax. you can inspect the code here [1][2]. I am not able to reproduce any issues with target or exlcude, and would therefore encourage sending a patch if this is something you can reliably reproduce.

[1] https://github.com/drone/drone-yaml/blob/master/yaml/cond.go#L26
[2] https://github.com/drone/drone-yaml/blob/master/yaml/cond.go#L35

Hmm I think I may have confused myself - testing again this morning on a repository, everything seems to work correctly, as you are saying!

I must have taken a wrong turn when debugging my own issue yesterday - sorry for the misunderstanding!