@@ -11,9 +11,10 @@ import {
1111 sortDiagnostics ,
1212} from "./outcomes" ;
1313
14- const COMMENT_TITLE = ( projectName : string | null ) => MD . Heading (
15- `${ MD . Symbol . HeavyAsterisk } Stainless preview builds${ projectName ? ` for ${ projectName } ` : "" } ` ,
16- ) ;
14+ const COMMENT_TITLE = ( projectName : string | null ) =>
15+ MD . Heading (
16+ `${ MD . Symbol . HeavyAsterisk } Stainless preview builds${ projectName ? ` for ${ projectName } ` : "" } ` ,
17+ ) ;
1718
1819const COMMENT_FOOTER_DIVIDER = MD . Comment ( "stainless-preview-footer" ) ;
1920
@@ -42,7 +43,10 @@ export function printComment({
4243} :
4344 | ( { noChanges ?: never } & Omit < PrintCommentOptions , "noChanges" > )
4445 | ( { noChanges : true ; projectName : string } & {
45- [ K in keyof Omit < Omit < PrintCommentOptions , "noChanges" > , "projectName" > ] ?: never ;
46+ [ K in keyof Omit <
47+ Omit < PrintCommentOptions , "noChanges" > ,
48+ "projectName"
49+ > ] ?: never ;
4650 } ) ) {
4751 const Blocks = ( ( ) => {
4852 if ( noChanges ) {
@@ -567,12 +571,14 @@ export function parseCommitMessages(body?: string | null): {
567571export async function retrieveComment ( prNumber : number , projectName : string ) {
568572 const comments = await api ( ) . listComments ( prNumber ) ;
569573
570- const existingComment = comments . find ( ( comment ) =>
571- comment . body ?. includes ( COMMENT_TITLE ( projectName ) ) || (
572- // backwards compatibility for comments that don't include the project name
573- // TODO: remove this fallback eventually
574- ! comment . body ?. includes ( COMMENT_TITLE ( null ) + ' for' ) && comment . body ?. includes ( COMMENT_TITLE ( null ) )
575- ) ) ;
574+ const existingComment = comments . find (
575+ ( comment ) =>
576+ comment . body ?. includes ( COMMENT_TITLE ( projectName ) ) ||
577+ // backwards compatibility for comments that don't include the project name
578+ // TODO: remove this fallback eventually
579+ ( ! comment . body ?. includes ( COMMENT_TITLE ( null ) + " for" ) &&
580+ comment . body ?. includes ( COMMENT_TITLE ( null ) ) ) ,
581+ ) ;
576582
577583 if ( ! existingComment ) {
578584 return null ;
0 commit comments