mirror of https://github.com/tmux/tmux.git
add error count
parent
72661dd4df
commit
4a28c22696
|
@ -32,7 +32,14 @@ jobs:
|
|||
- name: Run clang-tidy
|
||||
run: |
|
||||
clang-tidy --version
|
||||
find . -path ./external -prune -o -name '*.c' -print | xargs clang-tidy -p $(pwd)
|
||||
find . -path ./external -prune -o -name '*.c' -print | xargs clang-tidy -p $(pwd) > clang-tidy-output.txt
|
||||
|
||||
- name: Count errors and warnings
|
||||
id: count-errors
|
||||
run: |
|
||||
error_count=$(grep -oP "error generated" clang-tidy-output.txt | wc -l)
|
||||
echo "error_count=$error_count" >> $GITHUB_ENV
|
||||
echo "::set-output name=error_count::$error_count"
|
||||
|
||||
comment-on-failure:
|
||||
name: Comment on PR if clang-tidy fails
|
||||
|
@ -51,7 +58,8 @@ jobs:
|
|||
with:
|
||||
script: |
|
||||
const issue_number = context.payload.pull_request.number;
|
||||
const comment_body = 'The linting workflow failed. Please check the clang-tidy output for details.';
|
||||
const errorCount = '${{ env.error_count }}';
|
||||
const comment_body = `The linting workflow failed with ${errorCount} errors. Please check the clang-tidy output for details.`;
|
||||
github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
|
|
Loading…
Reference in New Issue