From b9a9812ad94b4619a211d556fd7e068c4c064479 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 16 Nov 2022 18:07:12 +0800 Subject: [PATCH] Fix API --- .gitignore | 1 + pkg/runner/run_context.go | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 2415210..c5ac0d9 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ coverage.txt # megalinter report/ +act diff --git a/pkg/runner/run_context.go b/pkg/runner/run_context.go index 2bde1bc..74469bb 100644 --- a/pkg/runner/run_context.go +++ b/pkg/runner/run_context.go @@ -591,11 +591,11 @@ func (rc *RunContext) withGithubEnv(ctx context.Context, github *model.GithubCon hasProtocol := strings.HasPrefix(rc.Config.GitHubInstance, "http://") || strings.HasPrefix(rc.Config.GitHubInstance, "https://") if hasProtocol { env["GITHUB_SERVER_URL"] = rc.Config.GitHubInstance - env["GITHUB_API_URL"] = fmt.Sprintf("%s/api/v3", rc.Config.GitHubInstance) // FIXME: gitea is v1 not v3 + env["GITHUB_API_URL"] = fmt.Sprintf("%s/api/v1", rc.Config.GitHubInstance) // FIXME: gitea is v1 not v3 env["GITHUB_GRAPHQL_URL"] = fmt.Sprintf("%s/api/graphql", rc.Config.GitHubInstance) } else { env["GITHUB_SERVER_URL"] = fmt.Sprintf("https://%s", rc.Config.GitHubInstance) - env["GITHUB_API_URL"] = fmt.Sprintf("https://%s/api/v3", rc.Config.GitHubInstance) + env["GITHUB_API_URL"] = fmt.Sprintf("https://%s/api/v1", rc.Config.GitHubInstance) env["GITHUB_GRAPHQL_URL"] = fmt.Sprintf("https://%s/api/graphql", rc.Config.GitHubInstance) } }