Browse Source

[build] Map illegal chars in branch names for snapshot versions

Him188 2 years ago
parent
commit
e3891c0388
1 changed files with 2 additions and 1 deletions
  1. 2 1
      ci-release-helper/src/buildIndex/SnapshotVersions.kt

+ 2 - 1
ci-release-helper/src/buildIndex/SnapshotVersions.kt

@@ -20,7 +20,8 @@ import kotlinx.serialization.json.Json
 object GetNextSnapshotIndex {
     @JvmStatic
     fun main(args: Array<String>) {
-        val branch = args.getOrNull(0) ?: error("Missing branch argument")
+        val branch = args.getOrNull(0)?.replace(Regex("""[/\\.,`~!@#$%^&*(){}\[\]|;]"""), "-")
+            ?: error("Missing branch argument")
         val commitRef = args.getOrNull(1) ?: error("Missing commitRef argument")