This repository was archived by the owner on Feb 5, 2025. It is now read-only.

Description
Drone configs allow YAML anchors:
drone_gcs_cache_common: &drone_gcs_cache_common
image: homerovalle/drone-gcs-cache
settings:
bucket: foo
restore: true
environment:
GCS_CACHE_JSON_KEY:
from_secret: gcs_cache_json_key
then in practice:
- name: restore_master_caches
<<: *drone_gcs_cache_common
when:
event: push
branch: master
- name: restore_pr_caches
<<: *drone_gcs_cache_common
when:
event: pull_request
However, if combined with use of when: paths:, YAML anchors declared in the config cause Linter errors - they are apparently interpreted as steps with no name attribute.
Given:
kind: pipeline
type: docker
name: test
drone_gcs_cache_common: &drone_gcs_cache_common
image: homerovalle/drone-gcs-cache
settings:
bucket: foo
restore: true
steps:
- name: foo
image: node:12.14.1
commands:
- npm i
when:
paths:
include:
- README.md
This will break immediately when run by Drone:
Linter: invalid or missing step name
If the when block is removed completely: everything works.
when also works when paths is not present.
Help?