微调无人机管道步骤的条件

Fine tune conditions on steps of a drone pipeline

我有一个非常基本的 .drone.yml 文件:

kind: pipeline
name: default

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

我正在尝试了解 when 部分的可能配置。在官方文档中找不到任何内容。在哪里可以找到ymal这部分的API?

同意,这可以更好地记录下来。

有效值似乎是:

  • 推送
  • pull_request
  • 标签
  • 推广(仅限较新版本的 Drone)
  • 回滚(仅限较新版本的 Drone)
  • 部署(仅适用于旧版本的 Drone)

... 或上述使用 yaml 数组语法的任意组合(例如 event: [push, tag])。

新版 Drone 的来源: https://docker-runner.docs.drone.io/configuration/conditions/ 跳到页面下方大约 1/3 处的 'By Event' 标题。

旧版 Drone 的来源: https://0-8-0.docs.drone.io/step-conditions/ 跳到页面下方约 1/3 处的 'Events' 标题,并注意最后一个示例 "Execute a step for all build events",它隐含地告诉我们完整的有效值集。