File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -213,6 +213,10 @@ func detectDescription() string {
213213}
214214
215215func detectRepoURL () string {
216+ sanitizeURL := func (url string ) string {
217+ return strings .TrimPrefix (url , "git+" )
218+ }
219+
216220 // Try git remote
217221 ctx , cancel := context .WithTimeout (context .Background (), 5 * time .Second )
218222 defer cancel ()
@@ -233,11 +237,11 @@ func detectRepoURL() string {
233237 if json .Unmarshal (data , & pkg ) == nil {
234238 if repo , ok := pkg ["repository" ].(map [string ]any ); ok {
235239 if url , ok := repo ["url" ].(string ); ok {
236- return strings .TrimSuffix (url , ".git" )
240+ return sanitizeURL ( strings .TrimSuffix (url , ".git" ) )
237241 }
238242 }
239243 if repo , ok := pkg ["repository" ].(string ); ok {
240- return strings .TrimSuffix (repo , ".git" )
244+ return sanitizeURL ( strings .TrimSuffix (repo , ".git" ) )
241245 }
242246 }
243247 }
You can’t perform that action at this time.
0 commit comments