Skip to content

Commit

Permalink
Pretty print json (#42809)
Browse files Browse the repository at this point in the history
Co-authored-by: Peter Bengtsson <[email protected]>
  • Loading branch information
gracepark and peterbe authored Sep 18, 2023
1 parent 0940522 commit 76a5f0d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/actions-scripts/post-lints.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ async function main() {

core.info(`Creating issue for errors...`)

let reportBody = 'The following files have markdown lint warnings/errors:\n\n'
for (const [file, flaws] of Object.entries(JSON.parse(errors))) {
reportBody += `File: \`${file}\`:\n`
reportBody += `\`\`\`json\n${JSON.stringify(flaws, null, 2)}\n\`\`\`\n`
}

const reportProps = {
core,
octokit,
reportTitle: `Error(s) in content markdown file(s)`,
reportBody: JSON.stringify(errors, undefined, 2),
reportBody,
reportRepository: REPORT_REPOSITORY,
reportLabel: REPORT_LABEL,
}
Expand Down

0 comments on commit 76a5f0d

Please sign in to comment.