drone / go-convert

Package convert provides tools for converting pipeline configuration files to the Drone format.
Apache License 2.0
10 stars 8 forks source link

[drone] multiple anchor references fail #12

Closed jimsheldon closed 1 year ago

jimsheldon commented 1 year ago

Steps to reproduce

  1. Create example.yml

    kind: pipeline
    type: docker
    name: default
    
    anchors:
     - &first_anchor
       FIRST_VAR: value
     - &second_anchor
       SECOND_VAR: value
    
    steps:
     - name: hello
       image: busybox
       environment:
         <<: *first_anchor
         <<: *second_anchor
       commands:
       - echo hello
    
    trigger:
     branch:
     - main
  2. Run go-convert
    go-convert drone example.yml
    2023/03/13 16:50:27 yaml: unmarshal errors:
     line 16: mapping key "<<" already defined at line 15
bradrydzewski commented 1 year ago

go-convert is using the latest version of go-yaml. runner-go (drone) may be using a fork from buildkite. we should be able to use just the buildkite fork in the drone package, but still use go-yaml for everything else. cc @eoinmcafee00 can you take a look?

eoinmcafee00 commented 1 year ago

PR raised for this issue: https://github.com/drone/go-convert/pull/13 @bradrydzewski