2 # SPDX-license-identifier: Apache-2.0
4 export PATH=$PATH:/usr/local/bin/
7 # This Log should always exist
8 if [[ -e securityaudit.log ]] ; then
10 #check if log has errors
11 if grep ERROR securityaudit.log; then
15 grep 'ERROR' securityaudit.log | awk -F"ERROR - " '{ print $2 }' | tr -d "\'\"" > shortlog
17 # Only report to Gerrit when there are errors to report.
18 if [[ -s shortlog ]]; then
19 echo -e "\nposting security audit report to gerrit...\n"
20 ssh -p 29418 gerrit.opnfv.org \
21 "gerrit review -p $GERRIT_PROJECT \
22 -m \"$(cat shortlog)\" \
23 $GERRIT_PATCHSET_REVISION \