From 09537e44e7f22cd7901950361160c7cf4c505499 Mon Sep 17 00:00:00 2001 From: Juan Palacios Date: Mon, 13 Nov 2023 16:38:13 +1100 Subject: [PATCH] Use coverage.out file --- .github/actions/coverage/index.js | 4 +++- .github/workflows/coverage.yml | 6 +++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/actions/coverage/index.js b/.github/actions/coverage/index.js index 761c1b4d..a54259b6 100644 --- a/.github/actions/coverage/index.js +++ b/.github/actions/coverage/index.js @@ -1,4 +1,5 @@ const core = require('@actions/core'); +const fs = require('fs'); const inputs = { coverage: core.getInput('coverage'), @@ -8,6 +9,7 @@ const inputs = { (async () => { const { updateComment } = require("../../utils/github"); - await updateComment(inputs.coverage); + const data = fs.readFileSync(inputs.coverage, { encoding: 'utf8', flag: 'r' }); + await updateComment(data); })(); diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 2feb40c6..e97fe9ec 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -35,15 +35,15 @@ jobs: - name: Run Forge coverage run: | - echo "COVERAGE=$(forge coverage --report summary)" >> $GITHUB_OUTPUT + forge coverage --report summary > ./coverage.out id: coverage - name: Debug coverage report run: | - echo ${{ steps.coverage.outputs.COVERAGE }} + cat ./coverage.out - name: Publish report uses: ./.github/actions/coverage with: - coverage: ${{ steps.coverage.outputs.COVERAGE }} + coverage: ./coverage.out