Inquiry on Promotions

I’ve been exploring the “Deploy” feature in the Drone GUI and researching promotions. I was able to successfully get it to work however I noticed not only did the deploy trigger step deploy but also other steps that did not have any conditionals also ran under the default section; please see screenshot:

Here is my drone yaml file:

kind: pipeline
name: default

steps:
  - name: build
    image: node:12.16.1-alpine
    commands:
      - npm install
  
  

---
kind: pipeline
type: docker
name: deploy

steps:
  - name: promote-dev
    image: nytimes/drone-gke:0.10.1
    environment:
      TOKEN:
        from_secret: xxxxxxxxxxxxxxx
    settings:
      verbose: true
      project: xxxxxxx
      zone: us-east1-b
      cluster: xxxxxxxxxx
      skip_template: true
      skip_secret_template: true
    commands:
      - apk add gettext
      - gcloud container clusters get-credentials xxxxxxxxx --zone us-east1-b --project xxxxxx
      - envsubst <./kube/overlays/dev/kustomization.yaml >./kube/overlays/dev/kustomization.yaml.out
      - mv ./kube/overlays/dev/kustomization.yaml.out ./kube/overlays/dev/kustomization.yaml
      - kubectl apply -k kube/overlays/dev/
    when:
      event:
      - promote
      target:
      - development

I do not want the “build” step to run, only the “promote-dev”. How can I get only what I want to run and nothing else?

If you do not want a step to run when the event type is promotion, you can use the when clause to limit step execution. Here are some examples:

    when:
      event:
      - push
      - pull_request
      - tag
    when:
      event:
        exclude:
        - promote

however, in your example, the build step is the only step in the pipeline, which means you could just skip the entire pipeline, using the trigger clause.

kind: pipeline
name: default

steps:
  - name: build
    image: node:12.16.1-alpine
    commands:
      - npm install

trigger:
  event:
    exclude:
      - promote

Thank you very much @bradrydzewski, I was able to run only that 1 step now.