Skip to content

Commit 110b61f

Browse files
authored
Merge branch 'v2/master' into v2/pr/ci_log
2 parents d996f04 + e7e11d9 commit 110b61f

22 files changed

+1076
-381
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,20 @@ jobs:
5454
# '|| :' handles the case grep doesn't match, otherwise the script exits with 1 (error)
5555
errors=$(grep -E ':(?error|warn)[]]' /var/log/apache2/error.log) || :
5656
if [[ -z "${errors}" ]]; then exit 0; fi
57-
echo "::error::Found errors/warnings in error.log"
57+
echo "::error:: Found errors/warnings in error.log"
5858
echo "${errors}"
5959
exit 1
60+
- name: Check error.log
61+
run: |
62+
# Send requests & check log format
63+
# Valid request
64+
curl -s http://127.0.01/ > /dev/null || echo $?
65+
# Invalid request
66+
curl -s http://127.0.01/%2e%2f > /dev/null || echo $?
67+
# Check log format
68+
grep -F ModSecurity < /var/log/apache2/error.log | grep -vP "^\[[^\]]+\] \[security2:[a-z]+\] \[pid [0-9]+:tid [0-9]+\] (?:\[client [0-9.:]+\] )?ModSecurity" || exit 0
69+
# grep -v succeeded => found some lines with invalid format
70+
exit 1
6071
- name: Show httpd error log
6172
if: always()
6273
run: sudo cat /var/log/apache2/error.log

0 commit comments

Comments
 (0)