fix: use owner and repo name from API

solves casing problem
This commit is contained in:
EnixCoda 2020-03-31 00:13:41 +08:00
parent 2e1eaada63
commit c20c3e16e9
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD
2 changed files with 4 additions and 2 deletions

View file

@ -16,9 +16,11 @@ declare namespace GitHubAPI {
}
type MetaData = {
name: string
default_branch: string
html_url: string
owner: {
login: string
html_url: string
}
}

View file

@ -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,