File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,6 +51,14 @@ function commentBody(finding: Finding): string {
5151 return `**${ label } — ${ finding . title } **\n\nRule: \`${ finding . rule } \`\n\n${ finding . explanation } \n\n**Suggested resolution:** ${ finding . remediation } ${ suggestion } ` ;
5252}
5353
54+ function reviewDisclaimer ( ) : string {
55+ const maintainer = process . env . GITHUB_REVIEW_MAINTAINER ?. replace ( / ^ @ / , "" ) ;
56+ const escalation = maintainer
57+ ? `reply in the relevant thread and mention \`@${ maintainer } \``
58+ : "reply in the relevant thread for maintainer review" ;
59+ return `This is an AI-generated first pass and may be mistaken. If a finding is unclear or incorrect, ${ escalation } .` ;
60+ }
61+
5462function sourceContent (
5563 decoded : Buffer ,
5664 fileSize : number ,
@@ -309,7 +317,7 @@ export async function reviewPullRequest(input: {
309317 const fallback = summaryOnly . length
310318 ? `\n\n### Findings without an inline diff location\n\n${ summaryOnly . map ( ( finding ) => `- **${ finding . title } ** (\`${ finding . path } :${ finding . line } \`, ${ finding . rule } ): ${ finding . explanation } ${ finding . remediation } ` ) . join ( "\n" ) } `
311319 : "" ;
312- const body = `${ result . summary } ${ fallback } \n\n---\n_${ blockingCount > 0 ? `Automated review found ${ blockingCount } publication-blocking issue${ blockingCount === 1 ? "" : "s" } .` : "Automated extension review passed. A maintainer review is still required." } _` ;
320+ const body = `${ result . summary } ${ fallback } \n\n---\n_${ blockingCount > 0 ? `Automated review found ${ blockingCount } publication-blocking issue${ blockingCount === 1 ? "" : "s" } .` : "Automated extension review passed. A maintainer review is still required." } _\n\n ${ reviewDisclaimer ( ) } ` ;
313321 const { data : review } = await octokit . rest . pulls . createReview ( {
314322 ...coordinates ,
315323 commit_id : pull . head . sha ,
You can’t perform that action at this time.
0 commit comments