Skip to content

Commit d51fb25

Browse files
authored
Creder/safer custom workspace patterns (#66)
* Removing all slashes from branch name in the custom workspaces for safer traversal * Removing job name from multibranch custom workspace path
1 parent 5e685b0 commit d51fb25

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

core/src/main/kotlin/com/code42/jenkins/pipelinekt/core/Pipeline.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ data class Pipeline(
8383
val innerWriter = writer.inner()
8484
innerWriter.writeln("// Replace slashes and other special characters with underscores for safe filesystem paths")
8585
innerWriter.writeln("def safeBranch = env.BRANCH_NAME.replaceAll('/', '_').replaceAll(/[^A-Za-z0-9._-]/, '_')")
86-
innerWriter.writeln("customWorkspacePath = \"./workspace//\${env.JOB_NAME}-\${safeBranch}\"")
86+
innerWriter.writeln("customWorkspacePath = \"./workspace//\${safeBranch}\"")
8787
writer.writeln("}")
8888
writer.writeln("")
8989
}

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.21.12
1+
0.21.13

0 commit comments

Comments
 (0)