telegram vuln notification
continuous-integration/drone/push Build is passing Details
continuous-integration/drone/tag Build is passing Details
Vulnerability Scan / Daily Vulnerability Scan (push) Successful in 29s Details

This commit is contained in:
Paolo Asperti 2024-04-29 23:22:03 +02:00
parent 06e7b6ec0e
commit a6f29bdcd8
Signed by: paspo
GPG Key ID: 06D46905D19D5182
1 changed files with 22 additions and 2 deletions

View File

@ -3,6 +3,7 @@ name: Vulnerability Scan
on:
schedule:
- cron: "0 14 * * *"
- cron: "* * * * *"
workflow_dispatch:
jobs:
@ -24,6 +25,25 @@ jobs:
format: "json"
output: "trivy-results.json"
- name: count vulns
id: vulncount
run: |
echo "VULNCOUNT=$(jq '.Results[0].Vulnerabilities|length' trivy-results.json)" >> ${GITHUB_OUTPUT}
jq '.Results[0].Vulnerabilities|length' trivy-results.json
# if some vulnerability is found, we fail
- name: check output
run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
# - name: check output
# run: if [ $(jq '.Results[0].Vulnerabilities|length' trivy-results.json) -ne "0" ] ; then exit 1 ; fi
- name: send telegram notification
# if: failure()
uses: appleboy/telegram-action@master
with:
to: ${{ secrets.TELEGRAM_TO }}
token: ${{ secrets.TELEGRAM_TOKEN }}
format: markdown
message: |
ciao ${{ steps.vulncount.outputs.VULNCOUNT }}
# Found { { steps.vulncount.outputs.stdout }} vulnerabilities in {{ github.repository }}
# if: steps.build.outcome == 'success'