From 5d2f757b725973c83a0262fca2ea09bcffb1859c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Walter?= Date: Mon, 11 Sep 2023 17:21:40 +0200 Subject: [PATCH 1/2] Try action/github script --- .github/workflows/gas_reports.yml | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gas_reports.yml b/.github/workflows/gas_reports.yml index 2f11bdead..435946415 100644 --- a/.github/workflows/gas_reports.yml +++ b/.github/workflows/gas_reports.yml @@ -7,6 +7,7 @@ permissions: jobs: compare-snapshot: + permissions: write-all runs-on: ubuntu-latest steps: @@ -35,10 +36,20 @@ jobs: result="${result//$'\r'/'%0D'}" echo "::set-output name=result::${result}" - - name: Comment on PR - uses: thollander/actions-comment-pull-request@v2 + # - name: Comment on PR + # uses: thollander/actions-comment-pull-request@v2 + # with: + # message: "Snapshot Comparison Report:\n\n${{ + # steps.run-script.outputs.result }}" # Access the result output variable + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # comment_tag: gas-report + + - uses: actions/github-script@v6 with: - message: "Snapshot Comparison Report:\n\n${{ - steps.run-script.outputs.result }}" # Access the result output variable - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - comment_tag: gas-report + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: "Snapshot Comparison Report:\n\n${{steps.run-script.outputs.result }}" + }) From ed35fa467c431268ea0fbe3b526dc9fb152e3d27 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Walter?= Date: Mon, 11 Sep 2023 17:33:17 +0200 Subject: [PATCH 2/2] Add dedicated workflow for debug --- .github/workflows/gas_reports.yml | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/.github/workflows/gas_reports.yml b/.github/workflows/gas_reports.yml index 435946415..b3b29e661 100644 --- a/.github/workflows/gas_reports.yml +++ b/.github/workflows/gas_reports.yml @@ -35,21 +35,3 @@ jobs: result="${result//$'\n'/'%0A'}" result="${result//$'\r'/'%0D'}" echo "::set-output name=result::${result}" - - # - name: Comment on PR - # uses: thollander/actions-comment-pull-request@v2 - # with: - # message: "Snapshot Comparison Report:\n\n${{ - # steps.run-script.outputs.result }}" # Access the result output variable - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # comment_tag: gas-report - - - uses: actions/github-script@v6 - with: - script: | - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: "Snapshot Comparison Report:\n\n${{steps.run-script.outputs.result }}" - })