File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed
Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Check occ command syntax
2+
3+ on :
4+ pull_request :
5+ paths :
6+ - ' **.rst'
7+
8+ jobs :
9+ check-occ-command :
10+ name : Check occ command syntax
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v4
14+
15+ - name : Run script
16+ run : |
17+ RST_FILE="$(find ./ -name '*.rst')"
18+ mapfile -t RST_FILE <<< "$RST_FILE"
19+ for file in "${RST_FILE[@]}"; do
20+ LINES="$(grep "php occ" "$file")"
21+ if [ -n "$LINES" ]; then
22+ LINES="$(echo "$LINES" | grep -v "sudo -E -u www-data php occ")"
23+ fi
24+ if [ "$(echo "$LINES" | wc -l)" -gt 0 ]; then
25+ printf "%b%s%b\n" "\e[0;31m" "$file does not use the 'sudo -E -u www-data php occ' syntax in some places which is required." "\e[0m"
26+ echo "See $LINES"
27+ FAIL=1
28+ fi
29+ done
30+ if [ -n "$FAIL" ]; then
31+ exit 1
32+ fi
You can’t perform that action at this time.
0 commit comments