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