diff --git a/tools/mothership/worker_server/forge/forge.go b/tools/mothership/worker_server/forge/forge.go index df139b2c..25dd364e 100644 --- a/tools/mothership/worker_server/forge/forge.go +++ b/tools/mothership/worker_server/forge/forge.go @@ -18,5 +18,6 @@ type Authenticator struct { type Forge interface { GetAuthenticator() (*Authenticator, error) GetRemote() string + GetCommitViewerURL(repo string, commit string) string EnsureRepositoryExists(auth *Authenticator, repo string) error } diff --git a/tools/mothership/worker_server/forge/github/github.go b/tools/mothership/worker_server/forge/github/github.go index 93c62777..528e8889 100644 --- a/tools/mothership/worker_server/forge/github/github.go +++ b/tools/mothership/worker_server/forge/github/github.go @@ -168,6 +168,15 @@ func (f *Forge) GetRemote() string { return fmt.Sprintf("https://github.com/%s", f.organization) } +func (f *Forge) GetCommitViewerURL(repo string, commit string) string { + return fmt.Sprintf( + "https://github.com/%s/%s/commit/%s", + f.organization, + repo, + commit, + ) +} + func (f *Forge) EnsureRepositoryExists(auth *forge.Authenticator, repo string) error { // Cast AuthMethod to BasicAuth basicAuth := auth.AuthMethod.(*transport_http.BasicAuth)