diff --git a/.github/workflows/bench-turborepo.yml b/.github/workflows/bench-turborepo.yml index 7b67774a353c7..185b60e5c81c7 100644 --- a/.github/workflows/bench-turborepo.yml +++ b/.github/workflows/bench-turborepo.yml @@ -78,7 +78,7 @@ jobs: - name: Augment ttft data run: | - cd benchmark && node -r esbuild-register ./src/ttft-augment.ts ./ttft.json ${{github.run_id}} + cd benchmark && node -r esbuild-register ./src/ttft-augment.ts "$PWD/ttft.json" ${{github.run_id}} cat ./ttft.json # - name: Add Github Action Run URL to JSON diff --git a/benchmark/src/ttft-augment.ts b/benchmark/src/ttft-augment.ts index 437014a350c7b..a285b4b4df5d9 100644 --- a/benchmark/src/ttft-augment.ts +++ b/benchmark/src/ttft-augment.ts @@ -5,10 +5,16 @@ process.argv.forEach((val, index) => { console.log({ index, val }); }); -const contents = fs.readFileSync("../ttft.json"); +const filePath = process.argv[2]; +const runID = process.argv[3]; + +const contents = fs.readFileSync(filePath); const data = JSON.parse(contents.toString()); + const commitDetails = getCommitDetails(); + data.commitSha = commitDetails.commitSha; data.commitTimestamp = commitDetails.commitTimestamp; +data.runID = runID; -fs.writeFileSync("../ttft.json", JSON.stringify(data, null, 2)); +fs.writeFileSync(filePath, JSON.stringify(data, null, 2));