From 8c8399c6aa71056fc71c8c822774919670188c50 Mon Sep 17 00:00:00 2001 From: dmitrybugakov Date: Sat, 26 Aug 2023 10:27:08 +0200 Subject: [PATCH] [CLEANUP]: Update PR Comment, with github-script --- .github/workflows/benchmark.yml | 36 ++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 12 deletions(-) diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml index 82bfcb24..5ff9a5b8 100644 --- a/.github/workflows/benchmark.yml +++ b/.github/workflows/benchmark.yml @@ -43,16 +43,28 @@ jobs: path: benchmark-reports.tgz retention-days: 30 - - name: PR Comment - uses: github-actions-up-and-running/pr-comment@v1.0.1 - if: ${{ github.event_name == 'pull_request' }} + - name: Comment PR + if: github.event_name == 'pull_request' + uses: actions/github-script@v6 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} - message: | -
- BENCHMARK_REPORT - - ``` - ${{ env.BENCHMARK_REPORT }} - ``` -
+ github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const issue_number = context.issue.number; + const owner = context.repo.owner; + const repo = context.repo.repo; + const body = ` +
+ BENCHMARK_REPORT + + ~~~ + ${process.env.BENCHMARK_REPORT} + ~~~ +
+ `; + + github.rest.issues.createComment({ + issue_number, + owner, + repo, + body + }); \ No newline at end of file