From 9860ab222a867ce66f76a91be4147b5e4d01e8fd Mon Sep 17 00:00:00 2001 From: Md Armughanuddin Date: Thu, 13 Jun 2024 17:48:18 -0500 Subject: [PATCH] Updated JMH Benchmark Comment Action (#976) Replaced existing action with [actions/github-script@v7](https://github.com/marketplace/actions/github-script) --- .github/workflows/jmh-benchmark.yml | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/jmh-benchmark.yml b/.github/workflows/jmh-benchmark.yml index 9e59a448e1..fdbf4cc388 100644 --- a/.github/workflows/jmh-benchmark.yml +++ b/.github/workflows/jmh-benchmark.yml @@ -55,11 +55,20 @@ jobs: (echo 'Main Branch:'; echo '```' ; cat main_text.txt; echo '```'; echo 'With This PR:'; echo '```' ; cat pr_text.txt; echo '```') > benchmark.txt - name: Comment Benchmark - uses: mshick/add-pr-comment@v2 - if: always() # This step is for adding the comment - with: - message-path: benchmark.txt # The path to the message file to leave as a comment - message-id: benchmark + uses: actions/github-script@v7 + if: always() + with: + script: | + const fs = require('fs'); + const path = 'benchmark.txt'; + const output = fs.readFileSync(path, 'utf8'); + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: output + }); + - name: Stop VM if: always() run: gcloud compute instances stop nullway-jmh --zone=us-central1-a