@string(equals(substring(pipeline().globalParameters.ENVIRONMENT_ROOT_FOLDER,0,2)),(substring(pipeline().parameters.TargetPath),1,3)))
这会抛出错误:函数“等于”不接受 1 个参数
当我尝试使用与我的参数类似的动态内容时,我遇到了同样的错误。
)
,因此在解析表达式时,这个额外的括号被认为是 equals 函数的结尾。因此,删除它会得到所需的结果(即使第二个子字符串有一些错误,我已根据需要进行了更改)。@string(equals(substring(pipeline().parameters.root_folder,0,2),substring(pipeline().parameters.target_path,1,3)))
root_folder
和target_path
参数。你可以用这个:
@equals(tolower(pipeline().globalParameters.ENVIRONMENT),'prod')
这解决了问题