fix: use correct base URL if not enterprise (#125)

This commit is contained in:
Yucel Okcu 2024-06-20 00:20:51 +03:00 committed by GitHub
parent 662b3ddbc7
commit 287b77b470
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -44,7 +44,11 @@ func newApprovalEnvironment(client *github.Client, repoFullName, repoOwner strin
}
func (a approvalEnvironment) runURL() string {
return fmt.Sprintf("%s%s/actions/runs/%d", a.client.BaseURL.String(), a.repoFullName, a.runID)
baseUrl := a.client.BaseURL.String()
if strings.Contains(baseUrl, "github.com") {
baseUrl = "https://github.com/"
}
return fmt.Sprintf("%s%s/actions/runs/%d", baseUrl, a.repoFullName, a.runID)
}
func (a *approvalEnvironment) createApprovalIssue(ctx context.Context) error {