From 73019c1b44e4945a31c17bdb61f3f0fa14ca2615 Mon Sep 17 00:00:00 2001 From: tdurieux Date: Tue, 2 Apr 2024 14:46:45 +0100 Subject: [PATCH] fix: fix gh repository configuration --- src/Repository.ts | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Repository.ts b/src/Repository.ts index 3c39084..11b72a5 100644 --- a/src/Repository.ts +++ b/src/Repository.ts @@ -72,21 +72,24 @@ export default class Repository { } get source() { + const ghRepo = new GitHubRepository({ + name: this.model.source.repositoryName, + }); switch (this.model.source.type) { case "GitHubDownload": return new GitHubDownload({ repoId: this.repoId, commit: this.model.source.commit || "HEAD", - organization: "", - repoName: this.model.source.repositoryName || "", + organization: ghRepo.owner, + repoName: ghRepo.repo, getToken: () => this.getToken(), }); case "GitHubStream": return new GitHubStream({ repoId: this.repoId, commit: this.model.source.commit || "HEAD", - organization: "", - repoName: this.model.source.repositoryName || "", + organization: ghRepo.owner, + repoName: ghRepo.repo, getToken: () => this.getToken(), }); case "Zip": @@ -235,7 +238,9 @@ export default class Repository { // Only GitHubBase can be update for the moment if (this.source instanceof GitHubBase) { const token = await this.getToken(); - const ghRepo = new GitHubRepository({}); + const ghRepo = new GitHubRepository({ + name: this.model.source.repositoryName, + }); const branches = await ghRepo.branches({ force: true, accessToken: token,