From c20c3e16e9e427135f9a7864e72da7a679922302 Mon Sep 17 00:00:00 2001 From: EnixCoda Date: Tue, 31 Mar 2020 00:13:41 +0800 Subject: [PATCH] fix: use owner and repo name from API solves casing problem --- src/platforms/GitHub/Request.d.ts | 2 ++ src/platforms/GitHub/index.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/platforms/GitHub/Request.d.ts b/src/platforms/GitHub/Request.d.ts index 19614fc..c413a77 100644 --- a/src/platforms/GitHub/Request.d.ts +++ b/src/platforms/GitHub/Request.d.ts @@ -16,9 +16,11 @@ declare namespace GitHubAPI { } type MetaData = { + name: string default_branch: string html_url: string owner: { + login: string html_url: string } } diff --git a/src/platforms/GitHub/index.ts b/src/platforms/GitHub/index.ts index d9a5bd9..01caead 100644 --- a/src/platforms/GitHub/index.ts +++ b/src/platforms/GitHub/index.ts @@ -102,8 +102,8 @@ export const GitHub: Platform = { const { userName, repoName, branchName } = rawMetaData const data = await API.getRepoMeta(userName, repoName, accessToken) const metaData: MetaData = { - userName, - repoName, + userName: data.owner.login, + repoName: data.name, branchName, userUrl: data?.owner?.html_url, repoUrl: data?.html_url,