jenkinsci / jenkinsci/script-security-plugin
[JENKINS-53302] Pipeline script from SCM: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods round, org.codehaus.groovy.runtime.DefaultGroovyMethods toFloat
- Dominant language
- Java
- Stars
- 76
- Forks
- 181
- Avg merge
- 14h 55m
- Merged PRs (30d)
- 3
Description
In our project requirement we are using groovy default methods "toFloat(), round()" while calculating next release version automatically, but it seems these methods are not whitelisted and requires manual approval from script Approval. Can these be added to whitelist by default ?
the sample code from pipeline script is below
node("xxxx"){
stage("get next version"){
def last_tag = "1.2.0"
def next_tag = (((last_tag.tokenize(".")[0] + "." + last_tag.tokenize(".")[1]).toFloat() + "0.1".toFloat()).round(2)) + "." + "0"
sh "echo " + next_tag
}
}
---
Originally reported by rgaduput, imported from: Pipeline script from SCM: Scripts not permitted to use staticMethod org.codehaus.groovy.runtime.DefaultGroovyMethods round, org.codehaus.groovy.runtime.DefaultGroovyMethods toFloat
Raw content of original issue
In our project requirement we are using groovy default methods "toFloat(), round()" while calculating next release version automatically, but it seems these methods are not whitelisted and requires manual approval from script Approval. Can these be added to whitelist by default ?
the sample code from pipeline script is below
node("xxxx"){
stage("get next version"){
def last_tag = "1.2.0"
def next_tag = (((last_tag.tokenize(".")[0] + "." + last_tag.tokenize(".")[1]).toFloat() + "0.1".toFloat()).round(2)) + "." + "0"
sh "echo " + next_tag
}
}
Contributor guide
Assessment
This issue has not been assessed yet.