try output value instead
@@ -8,6 +8,10 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: scan
+ outputs:
+ found-count:
+ description: "number of secrets found by whispers."
+ value: ${{ steps.scan.outputs.found-count }}
run: |
export DEBIAN_FRONTEND=noninteractive && \
echo 'debconf debconf/frontend select Noninteractive' | sudo debconf-set-selections && \
@@ -18,14 +22,15 @@ jobs:
python3 -m pip install --upgrade pip && \
pip3 install whispers && \
mkdir /reports/ && \
- whispers --severity BLOCKER,CRITICAL -o /reports/whispers.json ${GITHUB_WORKSPACE}
+ whispers --severity BLOCKER,CRITICAL -o /reports/whispers.json ${GITHUB_WORKSPACE} && \
+ echo "::set-output name=found-count::$(wc -l /reports/whispers.json | cut -d' ' -f1)"
- name: Upload scan reports
uses: actions/upload-artifact@v2.3.1
with:
name: whispers-report
path: /reports/whispers.json
- name: Fail if found
- if: ${wc -l /reports/whispers.json | cut -d' ' -f1} != 0
+ if: ${{steps.scan.outputs.found-count}} != 0
uses: actions/github-script@v3
with:
script: |
