File tree Expand file tree Collapse file tree 3 files changed +9
-51
lines changed
src/tools/review-agent-utils Expand file tree Collapse file tree 3 files changed +9
-51
lines changed Original file line number Diff line number Diff line change @@ -33,13 +33,14 @@ export async function getPercyBuildCount(percyToken: string) {
3333 } else {
3434 isFirstBuild = builds . length === 1 ;
3535 lastBuildId = builds [ 0 ] . id ;
36-
37- browserIds =
38- builds [ 0 ] ?. relationships ?. browsers ?. data
39- ?. map ( ( b : any ) => b . id )
40- ?. filter ( ( id : any ) => typeof id === "string" ) ?? [ ] ;
4136 }
4237
38+ // Extract browserIds from the latest build if available
39+ browserIds =
40+ builds [ 0 ] ?. relationships ?. browsers ?. data
41+ ?. map ( ( b : any ) => b . id )
42+ ?. filter ( ( id : any ) => typeof id === "string" ) ?? [ ] ;
43+
4344 // Extract orgId from the `included` projects block
4445 const project = included . find ( ( item : any ) => item . type === "projects" ) ;
4546 if ( project ?. relationships ?. organization ?. data ?. id ) {
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export async function approveOrDeclinePercyBuild(
99 const { buildId, action } = args ;
1010
1111 // Get Basic Auth credentials
12- const [ username , accessKey ] = getBrowserStackAuth ( config ) . split ( ":" ) ;
13- const authHeader = `Basic ${ Buffer . from ( ` ${ username } : ${ accessKey } ` ) . toString ( "base64" ) } ` ;
12+ const authString = getBrowserStackAuth ( config ) ;
13+ const auth = Buffer . from ( authString ) . toString ( "base64" ) ;
1414
1515 // Prepare request body
1616 const body = {
@@ -28,7 +28,7 @@ export async function approveOrDeclinePercyBuild(
2828 method : "POST" ,
2929 headers : {
3030 "Content-Type" : "application/json" ,
31- Authorization : authHeader ,
31+ Authorization : `Basic ${ auth } ` ,
3232 } ,
3333 body : JSON . stringify ( body ) ,
3434 } ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments