MCPcopy Create free account
hub / github.com/decaporg/decap-cms / findUserFork

Method findUserFork

packages/decap-cms-backend-forgejo/src/API.ts:1050–1063  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1048 // won't be found under the origin repo name. Look it up among the user's repos,
1049 // which are usually far fewer than the origin's forks.
1050 async findUserFork(): Promise<ForgejoRepository | undefined> {
1051 try {
1052 const repos = await this.requestAllPages<ForgejoRepository>('/user/repos', {
1053 params: { limit: 50 },
1054 });
1055 return repos.find(
1056 repo =>
1057 repo.owner.login.toLowerCase() === this.repoOwner.toLowerCase() &&
1058 this.isForkOfOrigin(repo),
1059 );
1060 } catch {
1061 return undefined;
1062 }
1063 }
1064
1065 async createFork(): Promise<ForgejoRepository> {
1066 return this.request(`${this.originRepoURL}/forks`, {

Callers 2

authenticateWithForkMethod · 0.80
API.spec.jsFile · 0.80

Calls 2

isForkOfOriginMethod · 0.95
findMethod · 0.80

Tested by

no test coverage detected