From 5412ddcbfeb4e32e854f9fc2e94829a004d1a352 Mon Sep 17 00:00:00 2001 From: mr-uniswap <144828035+mr-uniswap@users.noreply.github.com> Date: Wed, 9 Oct 2024 18:43:56 -0400 Subject: [PATCH] fix: disable template injection --- .github/workflows/coverage.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml index 0bcf3c9de..c308cf5e2 100644 --- a/.github/workflows/coverage.yml +++ b/.github/workflows/coverage.yml @@ -32,7 +32,7 @@ jobs: run: | { echo 'COVERAGE<> "$GITHUB_OUTPUT" env: @@ -40,9 +40,12 @@ jobs: - name: Check coverage is updated uses: actions/github-script@v5 + env: + OUTPUT: ${{ steps.coverage.outputs.COVERAGE }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const { OUTPUT } = process.env; const fs = require('fs'); const file = "coverage.txt" if(!fs.existsSync(file)) { @@ -50,7 +53,7 @@ jobs: return } const currentCoverage = fs.readFileSync(file, "utf8").trim(); - const newCoverage = (`${{ steps.coverage.outputs.COVERAGE }}`).trim(); + const newCoverage = (`${ OUTPUT }`).trim(); if (newCoverage != currentCoverage) { core.setFailed(`Code coverage not updated. Run : forge coverage | grep '^|' | grep -v 'test/' > coverage.txt`); } @@ -58,9 +61,12 @@ jobs: - name: Comment on PR id: comment uses: actions/github-script@v5 + env: + OUTPUT: ${{ steps.coverage.outputs.COVERAGE }} with: github-token: ${{ secrets.GITHUB_TOKEN }} script: | + const { OUTPUT } = process.env; const {data: comments} = await github.rest.issues.listComments({ owner: context.repo.owner, repo: context.repo.repo, @@ -69,8 +75,7 @@ jobs: const botComment = comments.find(comment => comment.user.id === 41898282) - const output = `${{ steps.coverage.outputs.COVERAGE }}`; - const commentBody = `Forge code coverage:\n${output}\n`; + const commentBody = `Forge code coverage:\n${ OUTPUT }\n`; if (botComment) { github.rest.issues.updateComment({