Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Commit

Permalink
Merge pull request #16 from FernandVEYRIER/fix/comment-crash
Browse files Browse the repository at this point in the history
  • Loading branch information
0x4007 authored Feb 13, 2024
2 parents 626aed0 + a383098 commit c371d28
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions src/helpers/get-linked-issues-and-pull-requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ export async function getLinkedPullRequests(
if (parts.length < 4) continue;

// extract the organization name and repo name from the link:(e.g. "
const organization = parts[parts.length - 4];
const repository = parts[parts.length - 3];
const currentOrganization = parts[parts.length - 4];
const currentRepository = parts[parts.length - 3];
const number = Number(parts[parts.length - 1]);
const href = `https://github.com${relativeHref}`;

if (`${organization}/${repository}` !== `${owner}/${repository}`) {
if (`${currentOrganization}/${currentRepository}` !== `${owner}/${repository}`) {
// logger.info("Skipping linked pull request from another repository", href);
continue;
}

collection.push({ organization, repository, number, href });
collection.push({ organization: currentOrganization, repository: currentRepository, number, href });
}

return collection;
Expand Down
6 changes: 3 additions & 3 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ async function getUser(authenticatedOctokit: Octokit, username: string): Promise
});
return user as GitHubUser;
} catch (e: unknown) {
throw new Error("fetching user failed!");
throw new Error(`fetching user failed! ${e}`);
}
}

Expand All @@ -140,7 +140,7 @@ async function getIssue(
});
return issue as GitHubIssue;
} catch (e: unknown) {
throw new Error("fetching issue failed!");
throw new Error(`fetching issue failed! ${e}`);
}
}

Expand All @@ -163,7 +163,7 @@ async function getIssueComments(
})) as GitHubComment[];
return comments;
} catch (e: unknown) {
throw new Error("Fetching all issue comments failed!");
throw new Error(`Fetching all issue comments failed! ${e}`);
}
}
async function getPullRequestComments(
Expand Down

0 comments on commit c371d28

Please sign in to comment.