drone / go-convert

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

[downgrade] quoted keys breaks conversion #169

Open jimsheldon opened 8 months ago

jimsheldon commented 8 months ago

Here is a v1 pipeline with a quoted key (to make sure on is treated as a string rather than a boolean)

stages:
- name: test
  spec:
    steps:
    - name: job1
      "on":
        failure:
          errors:
          - all
          type: ignore
      spec:
        run: execute_script_1
      type: script
  type: ci
version: 1

Currently this fails to downgrade

2023/08/16 10:14:24 unexpected end of JSON input

Removing the double quotes around on converts successfully.

downgrade needs to allow for keys that are in double quotes.

jimsheldon commented 8 months ago

Fix in #176