diff --git a/dist/index.mjs b/dist/index.mjs index 5cbaad945826960a6b77b44bf9661e1c2523c16d..6df2474578cdcf2b6d26330bd23dbb48a24ecafe 100644 --- a/dist/index.mjs +++ b/dist/index.mjs @@ -914,13 +914,7 @@ async function uploadFilesToS3(files) { await uploadFilesToS3(uploadFiles); // Update build debug("Updating build"); - const uploadBuildResponse = await apiClient.PUT("/builds/{buildId}", { - params: { - path: { - buildId: result.build.id - } - }, - body: { + const body = { screenshots: screenshots.map((screenshot)=>({ key: screenshot.hash, name: screenshot.name, @@ -933,9 +927,18 @@ async function uploadFilesToS3(files) { parallelTotal: config.parallelTotal, parallelIndex: config.parallelIndex, metadata: params.metadata - } + }; + const uploadBuildResponse = await apiClient.PUT("/builds/{buildId}", { + params: { + path: { + buildId: result.build.id + } + }, + body }); if (uploadBuildResponse.error) { + console.error(JSON.stringify({body, buildId: result.build.id}, null, 2)) + console.error(JSON.stringify(uploadBuildResponse, null, 2)) throwAPIError(uploadBuildResponse); } return {