[solved] Cloud: triggers - include/exclude not working as expected?

Here’s my .drone.yml

---
kind: pipeline
name: default
trigger:
  ref:
    include:
      - refs/tags/**

steps:
- name: Create voltagex/fedora-mingw64-qemu image  
  image: plugins/docker
#  Only rebuild the Fedora/MinGW container when we tag container specifically
  trigger:
    ref:
      include: 
        - refs/tags/container-*
      exclude:
        - refs/tags/**
  settings:
    username: voltagex
    password:
      from_secret: docker_auth
    repo: voltagex/fedora-mingw64-qemu
    dockerfile: Dockerfile.fedora-builder

- name: Get QEMU sources
  image: docker:git
  trigger:
    ref:
      include: 
        - refs/tags/release-*
      exclude:
        - refs/tags/**
  commands:
  - git clone https://github.com/qemu/qemu --recursive

- name: Build QEMU via mingw64 via Docker
  image: voltagex/fedora-mingw64-qemu
  trigger:
    ref:
      include: 
        - refs/tags/release-*
      exclude:
        - refs/tags/**
  environment:
    UPLOAD_AUTH:
      from_secret: upload_auth
  commands:
  - mv drone-helper.sh qemu/ && cd qemu && ./drone-helper.sh
  
- name: publish  
  image: plugins/github-release
  trigger:
    ref:
      include: 
        - refs/tags/release-*
      exclude:
        - refs/tags/**
  settings:
    api_key:
      from_secret: github_token
    files: /qemu.tar.gz

With this, I’d expect tags starting with release- to run the build/release steps, and container- to run the container rebuild. However, all steps seem to be running for all tags. What am I doing wrong?

see: https://cloud.drone.io/baxterworks-build/qemu-builder/53 and https://cloud.drone.io/baxterworks-build/qemu-builder/52

Triggers are defined at the pipeline level. If you want to limit execution of individual steps you need to define when conditions. See https://docs.drone.io/pipeline/docker/syntax/conditions/

steps:
  - name: Create voltagex/fedora-mingw64-qemu image  
    image: plugins/docker
-   trigger:
+   when:
      ref:
        include: 
          - refs/tags/container-*
        exclude:
          - refs/tags/**
1 Like