internal/source: support github.* URLs

These URLs are used by some GitHub Enterprise Server customers.

For golang/go#48542

Change-Id: Iace7e9db14fcb776669c2ae581a7508c188c1aca
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/351276
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Jonathan Amsterdam <jba@google.com>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/source/source.go b/internal/source/source.go
index e66ef4d..bcc7e94 100644
--- a/internal/source/source.go
+++ b/internal/source/source.go
@@ -639,6 +639,11 @@
 		templates: githubURLTemplates,
 	},
 	{
+		// Assume that any site beginning with "github." works like github.com.
+		pattern:   `^(?P<repo>github\.[a-z0-9A-Z.-]+/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+)(\.git|$)`,
+		templates: githubURLTemplates,
+	},
+	{
 		pattern:   `^(?P<repo>bitbucket\.org/[a-z0-9A-Z_.\-]+/[a-z0-9A-Z_.\-]+)`,
 		templates: bitbucketURLTemplates,
 	},