Skip to content

Commit

Permalink
Fix clang-tidy action
Browse files Browse the repository at this point in the history
  • Loading branch information
kuznetsss committed Dec 8, 2023
1 parent 8cdafb4 commit 25a9ad4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/actions/clang_tidy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ runs:
id: run_clang_tidy
run: |
run-clang-tidy-17 -p build -j ${{ steps.number_of_threads.outputs.threads_number }} -fix -quiet 1>output.txt
if [[ "$?" != 0 ]]; then
echo 'clang_tidy_failed=true' >> $GITHUB_OUTPUT
fi
sed -i '/error\||/!d' ./output.txt
- name: Print issues found
if: ${{ steps.run_clang_tidy.outcome != 'success' }}
shell: bash
run: cat output.txt
run: |
sed -i '/error\||/!d' ./output.txt
cat output.txt
- name: Create an issue
if: ${{ steps.run_clang_tidy.outputs.clang_tidy_failed == 'true' }}
if: ${{ steps.run_clang_tidy.outcome != 'success' }}
id: create_issue
shell: bash
run: |
Expand All @@ -34,7 +33,7 @@ runs:
echo "created_issue=$created_issue" >> $GITHUB_OUTPUT
- name: Create PR with fixes
if: ${{ steps.run_clang_tidy.outputs.clang_tidy_failed == 'true' }}
if: ${{ steps.run_clang_tidy.outcome != 'success' }}
uses: peter-evans/create-pull-request@v5
with:
commit-message: '[CI]: clang-tidy auto fixes'
Expand All @@ -46,6 +45,6 @@ runs:
reviewers: 'cindyyan317,godexsoft,kuznetsss'

- name: Fail the job
if: ${{ steps.run_clang_tidy.outputs.clang_tidy_failed == 'true' }}
if: ${{ steps.run_clang_tidy.outcome != 'success' }}
shell: bash
run: exit 1

0 comments on commit 25a9ad4

Please sign in to comment.