ci: Include clang-format version in lint summary
This could help confused developers understand why their clang-format is working differently to CI
This commit is contained in:
parent
2a84ef0ebf
commit
d7f882f0c4
1 changed files with 6 additions and 2 deletions
8
.github/actions/lint-check/action.yml
vendored
8
.github/actions/lint-check/action.yml
vendored
|
|
@ -48,8 +48,10 @@ runs:
|
||||||
run: |
|
run: |
|
||||||
code_block="\`\`\`"
|
code_block="\`\`\`"
|
||||||
|
|
||||||
summary=$(cat<<EOF
|
clang_version=$(clang-format --version | sed -n 's/^.*version //p')
|
||||||
❌ \`clang-format\`: It looks like your changes don't match our code style.
|
|
||||||
|
summary=$(cat <<EOF
|
||||||
|
❌ \`clang-format\` \`v${clang_version}\`: It looks like your changes don't match our code style.
|
||||||
|
|
||||||
🛠️ Please either run \`clang-format -i\` on the file or apply this patch with \`git apply\`:
|
🛠️ Please either run \`clang-format -i\` on the file or apply this patch with \`git apply\`:
|
||||||
|
|
||||||
|
|
@ -57,6 +59,8 @@ runs:
|
||||||
$code_block diff
|
$code_block diff
|
||||||
${{ steps.changes.outputs.diff }}
|
${{ steps.changes.outputs.diff }}
|
||||||
$code_block
|
$code_block
|
||||||
|
|
||||||
|
Hint: Install the right version of \`clang-format\`, e.g.: \`pipx install --global clang-format==${clang_version}\`
|
||||||
EOF
|
EOF
|
||||||
)
|
)
|
||||||
echo "$summary" >> $GITHUB_STEP_SUMMARY
|
echo "$summary" >> $GITHUB_STEP_SUMMARY
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue