From 8d249eda4657b472f50e0f139452dfc50e8b932f Mon Sep 17 00:00:00 2001 From: ikura-hamu <104292023+ikura-hamu@users.noreply.github.com> Date: Thu, 22 Aug 2024 20:18:02 +0900 Subject: [PATCH] =?UTF-8?q?:adhensive=5Fbandage:=20=E6=94=B9=E8=A1=8C?= =?UTF-8?q?=E6=96=87=E5=AD=97=E3=81=AE=E7=BD=AE=E3=81=8D=E6=8F=9B=E3=81=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- service/impl/github.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/service/impl/github.go b/service/impl/github.go index 6f17d08..2e018a6 100644 --- a/service/impl/github.go +++ b/service/impl/github.go @@ -7,6 +7,7 @@ import ( "net/http" "os" "strconv" + "strings" "github.com/bradleyfalzon/ghinstallation/v2" "github.com/google/go-github/v63/github" @@ -39,6 +40,8 @@ func NewGitHub(orgName string) (*GitHub, error) { return nil, errors.New("GITHUB_PRIVATE_KEY is not set") } + privateKeyStr = strings.ReplaceAll(privateKeyStr, "\\n", "\n") + irt, err := ghinstallation.New(http.DefaultTransport, gitHubAppID, gitHubAppInstallationID, []byte(privateKeyStr)) if err != nil { return nil, fmt.Errorf("failed to create GitHub installation round tripper: %w", err)