From f5b1862b8d1dd80df4659c01a4c11fb13d59745b Mon Sep 17 00:00:00 2001 From: zhangtao25 Date: Tue, 17 Dec 2024 10:42:44 +0800 Subject: [PATCH] chore: daily development --- packages/canyon-platform/app/api/sourcecode/route.ts | 4 ++-- tools/canyon-uploader/src/commands/map.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/canyon-platform/app/api/sourcecode/route.ts b/packages/canyon-platform/app/api/sourcecode/route.ts index d15a58e3..e631f23f 100644 --- a/packages/canyon-platform/app/api/sourcecode/route.ts +++ b/packages/canyon-platform/app/api/sourcecode/route.ts @@ -48,12 +48,12 @@ export async function GET(request: NextRequest) { gitProvider; // 对于github,其认证一般是通过Authorization头部带上token,格式为"Bearer " console.log( - `${"https://api.github.com/repos"}/repos/${id}/contents/${filepath}`, + `${"https://api.github.com"}/repos/${id}/contents/${"packages/canyon-report/" + filepath}`, sha, ); const githubResponse = await axios .get( - `${"https://api.github.com"}/repos/${id}/contents/${"packages/canyon-report" + filepath}`, + `${"https://api.github.com"}/repos/${id}/contents/${"packages/canyon-report/" + filepath}`, { // 注意这里params中ref要改为branch,因为github API此处参数名是branch(假设你传入的sha对应的是分支名情况) params: { diff --git a/tools/canyon-uploader/src/commands/map.ts b/tools/canyon-uploader/src/commands/map.ts index 124b6924..580fd8d4 100644 --- a/tools/canyon-uploader/src/commands/map.ts +++ b/tools/canyon-uploader/src/commands/map.ts @@ -35,7 +35,7 @@ export async function mapCommand(params, options) { } const reqData = { projectID: - projectID || process.env.CI_PROJECT_ID || process.env.GITHUB_REPOSITORY_ID, + projectID || process.env.CI_PROJECT_ID || process.env.GITHUB_REPOSITORY, sha: sha || process.env.CI_COMMIT_SHA || process.env.GITHUB_SHA, branch: branch || process.env.CI_COMMIT_BRANCH || process.env.GITHUB_REF, instrumentCwd: instrumentCwd || process.cwd(),