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

[downgrade] action `env` convert error #50

Closed jimsheldon closed 1 year ago

jimsheldon commented 1 year ago

Example GitHub Actions yaml:

jobs:
  job1:
    runs-on: ubuntu-latest
    steps:
      - name: echo
        uses: actions/hello-world-javascript-action@main
        with:
          who-to-greet: $MESSAGE
        env:
          MESSAGE: world

Converted downgraded yaml:

pipeline:
  identifier: default
  name: default
  orgIdentifier: default
  projectIdentifier: default
  properties:
    ci:
      codebase:
        build: <+input>
  stages:
  - stage:
      identifier: job1
      name: job1
      spec:
        cloneCodebase: true
        execution:
          steps:
          - step:
              identifier: echo
              name: echo
              spec:
                evn:
                  MESSAGE: world
                uses: actions/hello-world-javascript-action@main
                with:
                  who-to-greet: $MESSAGE
              timeout: ""
              type: Action
        platform:
          arch: Amd64
          os: Linux
        runtime:
          spec: {}
          type: Cloud
      type: CI

evn should be env.

jimsheldon commented 1 year ago

Please write a test for this in the downgrade logic.

eoinmcafee00 commented 1 year ago

Fixed by: https://github.com/drone/go-convert/commit/900da531dc8c43dae12665034a1273fa214b9b8c