From 41613100bdcd5b9dfa1f2feb3a51311052253f51 Mon Sep 17 00:00:00 2001 From: kminoda Date: Tue, 4 Jun 2024 15:10:32 +0900 Subject: [PATCH] fix Signed-off-by: kminoda --- .github/workflows/cpp-check.yaml | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/.github/workflows/cpp-check.yaml b/.github/workflows/cpp-check.yaml index ba3388bbe47c8..1e5d8f0bc57d1 100644 --- a/.github/workflows/cpp-check.yaml +++ b/.github/workflows/cpp-check.yaml @@ -11,10 +11,10 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Install Cppcheck and htmlreport + - name: Install Cppcheck run: | sudo apt-get update - sudo apt-get install -y cppcheck python3-lxml + sudo apt-get install -y cppcheck - name: Get changed files id: changed-files @@ -28,31 +28,7 @@ jobs: files=$(cat changed_files.txt | grep '\.cpp$\|\.h$' | tr '\n' ' ') if [ -n "$files" ]; then cppcheck --enable=warning,style,performance --error-exitcode=1 --xml $files 2> cppcheck-report.xml - cppcheck-htmlreport --file=cppcheck-report.xml --report-dir=cppcheck-html else echo "No C++ files changed." fi shell: bash - - - name: Upload Cppcheck HTML Report - if: failure() - uses: actions/upload-artifact@v2 - with: - name: cppcheck-html-report - path: cppcheck-html - - - name: Post results as comment - if: failure() && ${{ github.event_name == 'pull_request' }} - uses: actions/github-script@v6 - with: - script: | - const fs = require('fs'); - const path = 'cppcheck-html/index.html'; - const htmlReport = fs.readFileSync(path, { encoding: 'utf8' }); - const comment = `Cppcheck Analysis:\n\n${htmlReport}`; - github.rest.issues.createComment({ - issue_number: context.issue.number, - owner: context.repo.owner, - repo: context.repo.repo, - body: comment - }); \ No newline at end of file