Search for errors/warnings in error log and stop if found

This commit is contained in:
Marc Stern
2024-08-02 11:19:34 +02:00
parent ee9a2353a5
commit 8723294cd1

View File

@@ -49,6 +49,14 @@ jobs:
run: sudo apachectl configtest run: sudo apachectl configtest
- name: start apache with module - name: start apache with module
run: sudo systemctl restart apache2.service run: sudo systemctl restart apache2.service
- name: Search for errors/warnings in error log
run: |
errors="$(grep -E ":(?error|warn)[]]" /var/log/apache2/error.log)"
if [ -n "${errors}" ]; then
echo "Found errors/warnings in error.log"
echo "${errors}"
exit 1
fi
- name: Show httpd error log - name: Show httpd error log
if: always() if: always()
run: sudo cat /var/log/apache2/error.log run: sudo cat /var/log/apache2/error.log