Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-65366

readYaml doesn't ready yaml file containing 'on' key properly

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Major Major
    • None
    • Jenkins 2.277.2, Pipeline Utility Steps 2.7.1

      readYaml replaces 'on' key by true:

      pipeline {
          agent {
              label "linux"
          }
          stages {
              stage('Main') {
                  steps {
                      script {
                          sh 'echo "on: abc" > x.yaml'
                          def x = readYaml file: 'x.yaml'
                          echo "x=$x"
                      }
                  }
              }
          }
      }
      

      Output:

      + echo 'on: abc'
      [Pipeline] readYaml
      [Pipeline] echo
      x=[true:abc]
      

            rsandell rsandell
            alexeyt Alexey Trenikhin
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: