File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
waena-plugin/src/main/kotlin/com/github/rahulsom/waena Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -141,7 +141,17 @@ class WaenaPublishedPlugin : Plugin<Project> {
141141 val originUrl = origin ? : scmInfoPlugin.findProvider(project).calculateOrigin(project)
142142
143143 val hostedRepoRegex =
144- Regex (" ^(?:https?://|git://|git@)(?<host>[^/:]+)[:/](?<owner>[^/]+)/(?<repo>[^/]+?)(?:.git)?$" )
144+ Regex ("""
145+ ^ # Start of the string
146+ (?:https?://|git://|git@) # Match the protocol (http, https, git) or git@
147+ (?<host>[^/:]+) # Match the host (e.g., github.com)
148+ [/:] # Match either : or /
149+ (?<owner>[^/]+) # Match the owner (user or organization)
150+ / # Match the / separator
151+ (?<repo>[^/]+?) # Match the repository name (non-greedy)
152+ (?:.git)? # Optionally match the .git suffix
153+ $ # End of the string
154+ """ , RegexOption .COMMENTS )
145155 val matchResult = hostedRepoRegex.matchEntire(originUrl)
146156 val (host, repo) = matchResult?.let {
147157 val host = it.groups[" host" ]?.value ? : " "
You can’t perform that action at this time.
0 commit comments