Fix dependency alerting (#14457)

Automatic Merge
This commit is contained in:
Juho Nurminen
2020-05-04 14:21:47 +03:00
committed by GitHub
parent a6a58f99e7
commit cf3ba6661d

View File

@@ -5,7 +5,7 @@
# Get artifacts from CircleCI
report_artifacts=$(curl -s https://circleci.com/api/v1.1/project/gh/$CIRCLE_PROJECT_USERNAME/$CIRCLE_PROJECT_REPONAME/$CIRCLE_BUILD_NUM/artifacts)
json_url=$(echo $report_artifacts | jq -r 'map(select(.path == "Reports/OWASP/dependency-check-report.json").url)[0]')
json_report=$(curl -s $json_url)
json_report=$(curl -sL $json_url)
# Anything new?
vulnerability_count=$(echo $json_report | jq '[.dependencies[]?.vulnerabilities[]?.name]|length')
@@ -60,4 +60,4 @@ then
curl -s -X POST -d 'payload={"username": "Dependency-Check", "icon_url": "https://www.mattermost.org/wp-content/uploads/2016/04/icon.png", "text":
"'"$alert_message"'"
}' "$SAST_WEBHOOK_URL"
fi
fi