diff --git a/connectors/src/connectors/github/temporal/activities.ts b/connectors/src/connectors/github/temporal/activities.ts index 7e9f346b7597..eb98eb1e461f 100644 --- a/connectors/src/connectors/github/temporal/activities.ts +++ b/connectors/src/connectors/github/temporal/activities.ts @@ -106,13 +106,23 @@ export async function githubUpsertIssueActivity( page: resultPage, }); resultPageLogger.info("Fetching GitHub issue comments result page."); - const comments = await getIssueCommentsPage( - installationId, - repoName, - login, - issueNumber, - resultPage - ); + let comments = undefined; + try { + comments = await getIssueCommentsPage( + installationId, + repoName, + login, + issueNumber, + resultPage + ); + } catch (e) { + if (e instanceof Error && "status" in e && e.status === 404) { + // Github may return a 404 on the first page if the issue has no comments + break; + } else { + throw e; + } + } if (!comments.length) { break; }