mirror of
https://github.com/tdurieux/anonymous_github.git
synced 2026-07-09 15:17:49 +02:00
fix: fix gh repository configuration
This commit is contained in:
+10
-5
@@ -72,21 +72,24 @@ export default class Repository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get source() {
|
get source() {
|
||||||
|
const ghRepo = new GitHubRepository({
|
||||||
|
name: this.model.source.repositoryName,
|
||||||
|
});
|
||||||
switch (this.model.source.type) {
|
switch (this.model.source.type) {
|
||||||
case "GitHubDownload":
|
case "GitHubDownload":
|
||||||
return new GitHubDownload({
|
return new GitHubDownload({
|
||||||
repoId: this.repoId,
|
repoId: this.repoId,
|
||||||
commit: this.model.source.commit || "HEAD",
|
commit: this.model.source.commit || "HEAD",
|
||||||
organization: "",
|
organization: ghRepo.owner,
|
||||||
repoName: this.model.source.repositoryName || "",
|
repoName: ghRepo.repo,
|
||||||
getToken: () => this.getToken(),
|
getToken: () => this.getToken(),
|
||||||
});
|
});
|
||||||
case "GitHubStream":
|
case "GitHubStream":
|
||||||
return new GitHubStream({
|
return new GitHubStream({
|
||||||
repoId: this.repoId,
|
repoId: this.repoId,
|
||||||
commit: this.model.source.commit || "HEAD",
|
commit: this.model.source.commit || "HEAD",
|
||||||
organization: "",
|
organization: ghRepo.owner,
|
||||||
repoName: this.model.source.repositoryName || "",
|
repoName: ghRepo.repo,
|
||||||
getToken: () => this.getToken(),
|
getToken: () => this.getToken(),
|
||||||
});
|
});
|
||||||
case "Zip":
|
case "Zip":
|
||||||
@@ -235,7 +238,9 @@ export default class Repository {
|
|||||||
// Only GitHubBase can be update for the moment
|
// Only GitHubBase can be update for the moment
|
||||||
if (this.source instanceof GitHubBase) {
|
if (this.source instanceof GitHubBase) {
|
||||||
const token = await this.getToken();
|
const token = await this.getToken();
|
||||||
const ghRepo = new GitHubRepository({});
|
const ghRepo = new GitHubRepository({
|
||||||
|
name: this.model.source.repositoryName,
|
||||||
|
});
|
||||||
const branches = await ghRepo.branches({
|
const branches = await ghRepo.branches({
|
||||||
force: true,
|
force: true,
|
||||||
accessToken: token,
|
accessToken: token,
|
||||||
|
|||||||
Reference in New Issue
Block a user