improve git path sanity

This commit is contained in:
Clemens Lauermann 2020-04-21 00:15:21 +02:00
parent 4caf1a51ac
commit f9b5a4b129

6
Jenkinsfile vendored
View File

@ -47,8 +47,12 @@ pipeline {
env.GIT_PATH = env.GIT_PATH.substring(1)
}
if(env.GIT_PATH.startsWith("~/")) {
env.GIT_PATH = env.GIT_PATH.substring(2, (env.GIT_PATH.length() - 1))
env.GIT_PATH = env.GIT_PATH.substring(2)
}
if(env.GIT_PATH.contains("../")) {
error("GIT_PATH must not contain '../'")
]
// be sure branch is set
env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master'
}