( githubToken: string, context: PullRequestContext, comments: Comment[], review: string | undefined, minimumSeverity: string, )
| 465 | } |
| 466 | |
| 467 | async function postFallbackComments( |
| 468 | githubToken: string, |
| 469 | context: PullRequestContext, |
| 470 | comments: Comment[], |
| 471 | review: string | undefined, |
| 472 | minimumSeverity: string, |
| 473 | ): Promise<void> { |
| 474 | core.info('📝 Server could not post comments - posting as fallback...'); |
| 475 | |
| 476 | try { |
| 477 | const octokit = github.getOctokit(githubToken); |
| 478 | const { |
| 479 | lineComments: preparedLineComments, |
| 480 | generalComments, |
| 481 | reviewBody, |
| 482 | } = prepareComments(comments, review, minimumSeverity); |
| 483 | const { lineComments, invalidLineComments } = await partitionReviewCommentsByDiff( |
| 484 | githubToken, |
| 485 | context, |
| 486 | preparedLineComments, |
| 487 | ); |
| 488 | |
| 489 | await postReview(octokit, context, lineComments, reviewBody); |
| 490 | await postGeneralComments(octokit, context, [...generalComments, ...invalidLineComments]); |
| 491 | |
| 492 | core.info('✅ All comments posted to PR by action'); |
| 493 | } catch (error) { |
| 494 | core.error(`Failed to post comments: ${formatError(error)}`); |
| 495 | core.warning('Comments could not be posted to PR'); |
| 496 | } |
| 497 | } |
| 498 | |
| 499 | // The shared symlink-safe containment check lives at src/util/isPathWithinDir.ts, but |
| 500 | // importing it transitively pulls src/logger.ts (and the winston stack) into this bundle, |
no test coverage detected
searching dependent graphs…