Why is the tag event does not get triggered?

Hi all

I am trying to use the tag event in Drone and have created the following pipeline:

kind: pipeline
type: docker
name: Using event tag

steps:
  - name: echo some variables
    image: busybox:1.31.1
    settings:
      commit: ${DRONE_COMMIT_MESSAGE}
      url: ${DRONE_GIT_HTTP_URL}
      semver: ${DRONE_SEMVER}
    commands:
      - echo $PLUGIN_COMMIT
      - echo $PLUGIN_URL
      - echo $PLUGIN_SEMVER

  - name: wait for event tag
    image: busybox:1.31.1
    settings:
      tag: ${DRONE_TAG}
      semver: ${DRONE_SEMVER}
    commands:
      - echo I am waiting for event tag
      - echo $PLUGIN_TAG
      - echo $PLUGIN_SEMVER
    when:
      event:
        - tag

trigger:
  branch:
    - master  

When I commit and push, then the first step echo some variables starts to run.
After the push, I’ve tagged the repo and push it as the following:

git tag 0.1.0
git push origin --tags

But the step wait for event tag never starts. You can find the repo here: https://gitlab.com/oceanstack/playtag

Why Drone does not show the step wait for event tag :

Tag Push event is enabled on repo:

Screenshot from 2020-04-27 10-53-21
What am I doing wrong?

Thanks

Tags are a pointer to a commit, not a branch. The branch field is always going to be empty for tag events, which means the branch is empty and your trigger condition will never resolve to true. You therefore need to remove this block:

trigger:
  branch:
    - master
1 Like