1- import { context } from '@actions/github'
1+ import { context } from '@actions/github' ;
22import { Octokit } from '@octokit/rest' ;
33
4-
54export interface CodeReview {
65 body : string ;
76 comments : {
87 path : string ;
98 line : number ;
10- body : string
9+ body : string ;
1110 } [ ] ;
1211}
1312
@@ -32,7 +31,6 @@ export async function getPullRequestDiff(octokit: Octokit): Promise<string> {
3231 * Gets the full contents of all files that were modified in the pull request.
3332 */
3433export async function getModifiedFilesContext ( octokit : Octokit , ref : string ) {
35-
3634 // Get list of files changed in the PR
3735 const filesResponse = await octokit . rest . pulls . listFiles ( {
3836 owner : context . repo . owner ,
@@ -78,8 +76,10 @@ export async function getModifiedFilesContext(octokit: Octokit, ref: string) {
7876/**
7977 * Gets the text of any failed check runs for the commit, which may contain lint errors or test failures.
8078 */
81- export async function getFailedChecks ( octokit : Octokit , ref : string ) : Promise < { name : string ; output : string | null } [ ] > {
82-
79+ export async function getFailedChecks (
80+ octokit : Octokit ,
81+ ref : string ,
82+ ) : Promise < { name : string ; output : string | null } [ ] > {
8383 // Keep the query broad because our action runs, so some checks might still be 'in_progress' or 'queued'. We want 'completed' -> 'failure'
8484 const checksResponse = await octokit . rest . checks . listForRef ( {
8585 owner : context . repo . owner ,
@@ -113,7 +113,10 @@ export async function getFailedChecks(octokit: Octokit, ref: string): Promise<{n
113113/**
114114 * Posts the review comment to the pull request.
115115 */
116- export async function postReviewComment ( octokit : Octokit , { body, comments} : CodeReview ) : Promise < void > {
116+ export async function postReviewComment (
117+ octokit : Octokit ,
118+ { body, comments} : CodeReview ,
119+ ) : Promise < void > {
117120 await octokit . rest . pulls . createReview ( {
118121 owner : context . repo . owner ,
119122 repo : context . repo . repo ,
0 commit comments