From 2a53d2e5b60d49c6d1c51ffbafa2af90ef148c62 Mon Sep 17 00:00:00 2001 From: Dustin Brown Date: Tue, 5 Jan 2021 13:38:57 -0800 Subject: [PATCH] /.github/workflows/ci-performance-benchmarks.yaml: get results with javascript --- .../workflows/ci-performance-benchmarks.yaml | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ci-performance-benchmarks.yaml b/.github/workflows/ci-performance-benchmarks.yaml index 23f1e1cc44..d15f02af17 100644 --- a/.github/workflows/ci-performance-benchmarks.yaml +++ b/.github/workflows/ci-performance-benchmarks.yaml @@ -87,24 +87,24 @@ jobs: run: | echo "Get benchmark results here: $KEY" aws s3api get-object --bucket=performance-benchmarking-github-actions-results --key="$KEY" results.log - results=$(cat results.log) - - results="${results//$'\n'/'%0A'}" - echo "::set-output name=results::$results" env: KEY: ${{ steps.run-benchmarks.outputs.object-key }} - - name: View context attributes + - name: Post results to PR uses: actions/github-script@v3 with: github-token: ${{secrets.GITHUB_TOKEN}} script: | - console.log("This is body:", process.env.BODY) - github.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: `@${process.env.ACTOR}\n ${process.env.BODY}` - }) + fs = require('fs'); + fs.readFile(`${process.env.GITHUB_WORKSPACE}/results.log`, 'utf8', function (err,data) { + if (err) { + return console.log(err); + } + return github.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: `@${process.env.ACTOR}\n ${data}` + }); + }); env: - BODY: ${{ steps.get-results.outputs.results }} ACTOR: ${{ github.actor }}