mirror of https://github.com/wolfSSL/wolfssh.git
Fail the cppcheck job on a finding
The cppcheck step pipes through tee, so its exit code was lost and the job passed with findings. Run the step under bash, which sets pipefail, and upload the results file only when the step fails.pull/1340/merge
parent
1c456fc843
commit
00f3e74e1c
|
|
@ -24,6 +24,8 @@ jobs:
|
|||
- name: Run CppCheck
|
||||
id: cpp_check_run
|
||||
if: always()
|
||||
# bash gets -o pipefail, so tee keeps cppcheck's exit code
|
||||
shell: bash
|
||||
run: >
|
||||
cppcheck
|
||||
-UWSCPFILEHDR -UXSNPRINTF
|
||||
|
|
@ -41,7 +43,7 @@ jobs:
|
|||
3>&1 1>&2 2>&3 | tee cppcheck.txt
|
||||
|
||||
- name: Upload cppcheck results as artifact
|
||||
if: always()
|
||||
if: failure() && steps.cpp_check_run.outcome == 'failure'
|
||||
uses: actions/upload-artifact@v7
|
||||
with:
|
||||
name: wolfssh-${{ github.sha }}-cppcheck_results.txt
|
||||
|
|
|
|||
Loading…
Reference in New Issue