diff --git a/scripts/check-breaking-changes.sh b/scripts/check-breaking-changes.sh index 6ab9a9c8952..1a49e7646fd 100755 --- a/scripts/check-breaking-changes.sh +++ b/scripts/check-breaking-changes.sh @@ -37,16 +37,13 @@ while IFS=" " read -r -a package; do # Check if the comparison returned with a non-zero exit code # Record the output, maybe with some additional information STATUS=$? - CURRENT_REPORT=$(node ./scripts/levitate-parse-json-report.js) - echo $CURRENT_REPORT - # Final exit code # (non-zero if any of the packages failed the checks) if [ $STATUS -gt 0 ]; then EXIT_CODE=1 GITHUB_MESSAGE="${GITHUB_MESSAGE}**\\\`${PACKAGE_PATH}\\\`** has possible breaking changes ([more info](${GITHUB_JOB_LINK}#step:${GITHUB_STEP_NUMBER}:1))
" - GITHUB_LEVITATE_MARKDOWN+="##${PACKAGE_PATH}\n${CURRENT_REPORT}\n" + GITHUB_LEVITATE_MARKDOWN+="

${PACKAGE_PATH}

${CURRENT_REPORT}
" fi done <<<"$PACKAGES" diff --git a/scripts/levitate-parse-json-report.js b/scripts/levitate-parse-json-report.js index 751e511b66b..cbebdf44195 100644 --- a/scripts/levitate-parse-json-report.js +++ b/scripts/levitate-parse-json-report.js @@ -5,13 +5,14 @@ const data = JSON.parse(fs.readFileSync('data.json', 'utf8')); const stripAnsi = (string) => string.replace(/\u001b\[.*?m/g, ''); const printSection = (title, items) => { - let output = `### ${title}\n\n`; + let output = `

${title}

`; items.forEach((item) => { - output += `**${item.name}**\n`; - output += `${item.location}\n\n`; - output += '```' + (item.declaration ? 'typescript' : 'diff typescript') + '\n'; - output += item.declaration ? item.declaration : stripAnsi(item.diff); - output += '\n```\n\n'; + const language = item.declaration ? 'typescript' : 'diff'; + const code = item.declaration ? item.declaration : stripAnsi(item.diff); + + output += `${item.name}
`; + output += `${item.location}
`; + output += `
${code}

`; }); return output; };