From a multibranch Pipeline project, reads a file from the associated SCM and returns its contents.
Unlike the readFile
step, no workspace is required.
If the associated branch is not trusted, yet the file has been modified from its trusted version, an error is thrown.
Thus this step is useful for loading scripts or other files which might otherwise be used to run malicious commands.
Like checkout scm
, as a convenience it may also be used from a standalone project configured with Pipeline script from SCM,
in which case there is no security aspect.