We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5bbb0b commit 5de53ccCopy full SHA for 5de53cc
.github/workflows/ci.yml
@@ -51,13 +51,12 @@ jobs:
51
run: sudo systemctl restart apache2.service
52
- name: Search for errors/warnings in error log
53
run: |
54
- errors=$(grep -E ':(?error|warn)[]]' /var/log/apache2/error.log)
55
- if [[ -n "${errors}" ]]; then
56
- echo "Found errors/warnings in error.log"
57
- echo "${errors}"
58
- exit 1
59
- fi
60
- exit 0
+ # '|| :' handles the case grep doesn't match, otherwise the script exits with 1 (error)
+ errors=$(grep -E ':(?error|warn)[]]' /var/log/apache2/error.log) || :
+ if [[ -z "${errors}" ]]; then exit 0; fi
+ echo "Found errors/warnings in error.log"
+ echo "${errors}"
+ exit 1
61
- name: Show httpd error log
62
if: always()
63
run: sudo cat /var/log/apache2/error.log
0 commit comments