0

I have a very basic .drone.yml file:

kind: pipeline
name: default

steps:
  - name: build-testing-docker
    image: my-docker-repo/my-docker-image:latest
    when:
      event: pull_request

and I'm trying to understand what are the possible configurations of the when section. In was unable to find something in the official documentation. Where can I find the API of this part of the ymal?

Dror
  • 12,174
  • 21
  • 90
  • 160

1 Answers1

1

Agreed, this could be better documented.

It appears that the valid values are:

  • push
  • pull_request
  • tag
  • promote (only in newer versions of Drone)
  • rollback (only in newer versions of Drone)
  • deployment (only in older versions of Drone)

... or any combination of the preceding using yaml array syntax (e.g. event: [push, tag]).

Source for newer version of Drone: https://docker-runner.docs.drone.io/configuration/conditions/ Skip to the 'By Event' heading approx 1/3 of the way down the page.

Source for older version of Drone: https://0-8-0.docs.drone.io/step-conditions/ Skip to the 'Events' heading approx 1/3 of the way down the page, and note the final example, "Execute a step for all build events", which implicitly is telling us the full set of valid values.

Usas
  • 116
  • 7
  • Good point - I've updated the answer to include the changes in more recent versions of Drone. – Usas Sep 26 '19 at 01:19