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) {
33
33
} else {
34
34
isFirstBuild = builds . length === 1 ;
35
35
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" ) ?? [ ] ;
41
36
}
42
37
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
+
43
44
// Extract orgId from the `included` projects block
44
45
const project = included . find ( ( item : any ) => item . type === "projects" ) ;
45
46
if ( project ?. relationships ?. organization ?. data ?. id ) {
Original file line number Diff line number Diff line change @@ -9,8 +9,8 @@ export async function approveOrDeclinePercyBuild(
9
9
const { buildId, action } = args ;
10
10
11
11
// 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" ) ;
14
14
15
15
// Prepare request body
16
16
const body = {
@@ -28,7 +28,7 @@ export async function approveOrDeclinePercyBuild(
28
28
method : "POST" ,
29
29
headers : {
30
30
"Content-Type" : "application/json" ,
31
- Authorization : authHeader ,
31
+ Authorization : `Basic ${ auth } ` ,
32
32
} ,
33
33
body : JSON . stringify ( body ) ,
34
34
} ) ;
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments