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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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]
      

            Assignee:
            rsandell
            Reporter:
            Alexey Trenikhin
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: