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
9 echo -e "\nposting security audit report to gerrit...\n"
11 #check if log has errors
12 if grep ERROR securityaudit.log; then
16 grep 'ERROR' securityaudit.log | awk -F"ERROR - " '{ print $2 }' | tr -d "\'\"" > shortlog
18 # Only report to Gerrit when there are errors to report.
19 if [[ -s shortlog ]]; then
20 ssh -p 29418 gerrit.opnfv.org \
21 "gerrit review -p $GERRIT_PROJECT \
22 -m \"$(cat shortlog)\" \
23 $GERRIT_PATCHSET_REVISION \