only upload on failure
@@ -17,11 +17,6 @@ jobs:
mkdir /home/runner/reports/ && \
whispers --severity BLOCKER,CRITICAL -o /home/runner/reports/whispers.json ${GITHUB_WORKSPACE} && \
echo "::set-output name=found-count::$(wc -l /home/runner/reports/whispers.json | cut -d' ' -f1)"
- - name: Upload scan reports
- uses: actions/upload-artifact@v2.3.1
- with:
- name: whispers-report
- path: /home/runner/reports/whispers.json
- name: Fail if found
if: steps.scan.outputs.found-count != 0
uses: actions/github-script@v3
@@ -29,3 +24,9 @@ jobs:
script: |
echo {{steps.scan.outputs.found-count}} && \
core.setFailed('Secrets found. Please check the uploaded report')
+ - name: Upload scan reports
+ uses: actions/upload-artifact@v2.3.1
+ if: failure()
+ with:
+ name: whispers-report
+ path: /home/runner/reports/whispers.json
\ No newline at end of file
