From 927756f36b67d3fc160d64760a6320fc7d56e863 Mon Sep 17 00:00:00 2001 From: Jerry Date: Tue, 5 Dec 2023 21:09:17 +0800 Subject: [PATCH] test-your-pr: fix bot comment: format error [skip ci] Signed-off-by: Jerry --- .github/workflows/test-your-pr.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-your-pr.yml b/.github/workflows/test-your-pr.yml index 444147a..8a2613e 100644 --- a/.github/workflows/test-your-pr.yml +++ b/.github/workflows/test-your-pr.yml @@ -86,18 +86,19 @@ jobs: steps: - shell: bash run: | - echo ${{needs.build.outputs.generate_roa}} | base64 -d | tail > /tmp/buildjob_tail.log || echo 'internal error' > /tmp/buildjob_tail.log + echo ${{needs.build.outputs.generate_roa}} | base64 -d | tail > /tmp/buildjob_tail.log || echo 'internal error' >> /tmp/buildjob_tail.log - uses: actions/github-script@v7 with: github-token: ${{secrets.COMMENT_GITHUB_TOKEN}} script: | const fs = require('fs') + let l = fs.readFileSync('/tmp/buildjob_tail.log', { encoding: 'utf8', flag: 'r' }).replaceAll("```", "'''") github.rest.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: fs.readFileSync('/tmp/buildjob_tail.log', { encoding: 'utf8', flag: 'r' }) + body: `Your pull request failed the check:\`\`\`\n${l.trimEnd()}\n\`\`\`` }) - run: false