我正在尝试将 Jenkins 配置中定义的参数传递到声明性管道。当我使用内置字符串执行此操作时,一切正常:
string(name: 'rv', defaultValue: 'none', description: 'the release version')
Run Code Online (Sandbox Code Playgroud)
由于用户不应在“使用参数构建”屏幕中编辑这些值,因此我改用隐藏参数插件:
hidden(name: 'rv', defaultValue: 'none', description: 'the release version')
Run Code Online (Sandbox Code Playgroud)
但是当管道脚本运行时,这给了我一个错误:
WorkflowScript: 30: Invalid parameter type "hidden". Valid parameter types: [booleanParam, buildSelector, choice, credentials, file, gitParameter, text, password, run, string]
Run Code Online (Sandbox Code Playgroud)
有没有一种方法可以在声明性 Jenkins 管道中使用隐藏参数?