Message ID | pull.778.git.1604418931303.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | cba2504d3de3ccd6809fa2ab484c2aaeeef5379b |
Headers | show |
Series | ci: make the whitespace checker more robust | expand |
"Johannes Schindelin via GitGitGadget" <gitgitgadget@gmail.com> writes: > One thing we discussed earlier whether the log should be pasted as > pre-formatted text or not, and we fell on the side of not pre-formatting > it. However, in my tests, this does not look right > [https://github.com/dscho/git/pull/18#issuecomment-721160985], and it > looks much better pre-formatted > [https://github.com/dscho/git/pull/18#issuecomment-721167209] (even if > we unfortunately lose the direct link to the commit > [https://github.com/dscho/git/commit/68317764849af81b17c4b31906da20bdf2c52082] > ). What is shown in the log are lines from the source files that were checked, and we expect our source files are shown and edited in monospace with tabwidth=8, I think it does make sense to force the "pre-formatted" output. Thanks.
diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index 9d070b9cdf..80a961716b 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -58,12 +58,14 @@ jobs: - name: Add Check Output as Comment uses: actions/github-script@v3 id: add-comment + env: + log: ${{ steps.check_out.outputs.checkout }} with: script: | - github.issues.createComment({ + await github.issues.createComment({ issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - body: "Whitespace errors found in workflow ${{ github.workflow }}:\n\n${{ steps.check_out.outputs.checkout }}" + body: `Whitespace errors found in workflow ${{ github.workflow }}:\n\n\`\`\`\n${process.env.log.replace(/\\n/g, "\n")}\n\`\`\`` }) if: ${{ failure() }}