From e295e9ead04a1b30b230a134563d0700c9234788 Mon Sep 17 00:00:00 2001 From: Hugo Saint-Vignes Date: Mon, 23 Nov 2020 18:09:02 +0100 Subject: [PATCH] [github/workflows] Update Metrics to remove NumWorksBot Change-Id: Icfd19cbad5472f6bf81a2a1accb88e79ab7a115b --- .github/workflows/metrics-workflow.yml | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/metrics-workflow.yml b/.github/workflows/metrics-workflow.yml index 3becd5e36..ad0082b8d 100644 --- a/.github/workflows/metrics-workflow.yml +++ b/.github/workflows/metrics-workflow.yml @@ -1,5 +1,5 @@ name: Metrics -on: [pull_request] +on: [pull_request_target] jobs: binary-size: @@ -26,11 +26,14 @@ jobs: - name: Retrieve binary size analysis id: binary_size run: echo "::set-output name=table::$(python3 head/build/metrics/binary_size.py base/output/release/device/n0110/epsilon.elf head/output/release/device/n0110/epsilon.elf --labels Base Head --sections .text .rodata .bss .data --escape)" - - name: Prepare comment auth - run: echo "::set-env name=GITHUB_TOKEN::$(echo ZGExNWM1YzNlMjVkMWU5ZGFmOWQyY2UxMmRhYjJiN2ZhMWM4ODVhMA== | base64 --decode)" - name: Add comment - uses: actions/github@v1.0.0 - env: - GITHUB_TOKEN: ${{ env.GITHUB_TOKEN }} + uses: actions/github-script@v3.0.0 with: - args: comment ${{ steps.binary_size.outputs.table }} + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + await github.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.payload.pull_request.number, + body: `${{ steps.binary_size.outputs.table }}`, + });