I have a scripted Jenkins pipeline where I am using a multiline string parameter with name CUSTOM_YAML.
While building the job, I am giving the input of that parameter as yaml text and convert it to a .yaml file :
writeFile file: 'demo.yaml', text: params.DEMO_YAML
Now, I want to validate if the format of this yaml file (demo.yaml) is correct or not.
Note : Like there are multiple tools to do this manually (e.g https://codebeautify.org/yaml-validator ) where we can paste the text and click on validate and . But how can I achieve this in my Jenkins pipeline?