From 8fa145c5ac932bffb2a7b4317e7b8f8aef2de579 Mon Sep 17 00:00:00 2001 From: Yucel Okcu Date: Thu, 13 Jun 2024 12:45:45 +0300 Subject: [PATCH] fix: use correct base URL if not enterprise --- approval.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/approval.go b/approval.go index a34c647..5d4ae3e 100644 --- a/approval.go +++ b/approval.go @@ -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 {