- Version of Drone: latest docker image as of last week
- Github integration
- Kubernetes runner
.drone.yml:
---
kind: pipeline
type: kubernetes
name: default
steps:
- name: deploy-staging
when:
branch:
- master
image: node:latest
commands:
- bin/deploy.sh
- name: validate-build
when:
event:
- pull_request
image: node:latest
commands:
- yarn build
What I’m trying to do:
- Run the step called “deploy-staging” if the branch is master
- Run ONLY the step called “validate-build” if the event is a PR.
What it does:
- On a branch that isn’t a PR and isn’t master, just clones and passes right away
This is working correctly
- On a PR, source branch NOT named master of course, it runs both the deploy-staging and the validate-build step
Is there something wrong with what I’m doing here?
PS: I realize triggers could maybe be used to maybe prevent those extra “empty” builds from being made, but that’s not my main concern right now.