()
| 1019 | |
| 1020 | // Open Authoring (Fork) Support |
| 1021 | async forkExists(): Promise<boolean> { |
| 1022 | try { |
| 1023 | const repoName = this.originRepo.split('/')[1]; |
| 1024 | const userRepoPath = `/repos/${this.repoOwner}/${repoName}`; |
| 1025 | const repo = (await this.request(userRepoPath)) as ForgejoRepository; |
| 1026 | |
| 1027 | // Check if it's a fork and the parent is the origin repo |
| 1028 | const forkExists: boolean = |
| 1029 | repo.fork === true && |
| 1030 | !!repo.parent && |
| 1031 | repo.parent.full_name.toLowerCase() === this.originRepo.toLowerCase(); |
| 1032 | return forkExists; |
| 1033 | } catch { |
| 1034 | return false; |
| 1035 | } |
| 1036 | } |
| 1037 | |
| 1038 | async createFork(): Promise<ForgejoRepository> { |
| 1039 | return this.request(`${this.originRepoURL}/forks`, { |
no test coverage detected