[JIRA] (JENKINS-59012) Parameters in pipeline are acessible outside the params object

2 views
Skip to first unread message

hugo.charles@faurecia.com (JIRA)

unread,
Aug 20, 2019, 10:22:02 AM8/20/19
to jenkinsc...@googlegroups.com
hugo charles created an issue
 
Jenkins / Bug JENKINS-59012
Parameters in pipeline are acessible outside the params object
Issue Type: Bug Bug
Assignee: Unassigned
Components: pipeline
Created: 2019-08-20 14:21
Environment: Jenkins ver. 2.121.3
Priority: Minor Minor
Reporter: hugo charles

Parameters are accessible outside the params object, this is potentially harmful.

properties([
    parameters([string(defaultValue: 'foo', description: '', name: 'VERSION', trim: false)])
])node () {
    echo params.VERSION
    echo VERSION
    echo env.VERSION
    echo vErSiOn
    echo env.VerSiOn
}

Result

[Pipeline] {
[Pipeline] echo
foo
[Pipeline] echo
foo
[Pipeline] echo
foo
[Pipeline] echo
foo
[Pipeline] echo
foo
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline

It should only work for params.VERSION and return null in the other case.

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.11.2#711002-sha1:fdc329d)
Reply all
Reply to author
Forward
0 new messages