File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed
core/src/main/kotlin/com/code42/jenkins/pipelinekt/core Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,8 @@ data class Pipeline(
8181 writer.writeln(" def customWorkspacePath = null" )
8282 writer.writeln(" if (env.BRANCH_NAME) {" )
8383 val innerWriter = writer.inner()
84- innerWriter.writeln(" def safeBranch = env.BRANCH_NAME.replaceAll(/[^A-Za-z0-9._-]/, '_')" )
84+ innerWriter.writeln(" // Replace slashes and other special characters with underscores for safe filesystem paths" )
85+ innerWriter.writeln(" def safeBranch = env.BRANCH_NAME.replaceAll('/', '_').replaceAll(/[^A-Za-z0-9._-]/, '_')" )
8586 innerWriter.writeln(" customWorkspacePath = \" ./workspace//\$ {env.JOB_NAME}-\$ {safeBranch}\" " )
8687 writer.writeln(" }" )
8788 writer.writeln(" " )
Original file line number Diff line number Diff line change 1- 0.21.11
1+ 0.21.12
You can’t perform that action at this time.
0 commit comments