mirror of
https://github.com/peridotbuild/peridot.git
synced 2024-12-03 18:16:25 +00:00
Add GetCommitViewerURL to Forge
This commit is contained in:
parent
3a417acff0
commit
13207458f0
@ -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
|
||||
}
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user