improve git path sanity
This commit is contained in:
parent
4caf1a51ac
commit
f9b5a4b129
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -47,8 +47,12 @@ pipeline {
|
|||||||
env.GIT_PATH = env.GIT_PATH.substring(1)
|
env.GIT_PATH = env.GIT_PATH.substring(1)
|
||||||
}
|
}
|
||||||
if(env.GIT_PATH.startsWith("~/")) {
|
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
|
// be sure branch is set
|
||||||
env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master'
|
env.GIT_BRANCH = params.GIT_BRANCH ?: '*/master'
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user