Skip to content

standardize occ command documentation #5

standardize occ command documentation

standardize occ command documentation #5

name: Check occ command syntax
on:
pull_request:
paths:
- '**.rst'
jobs:
check-occ-command:
name: Check occ command syntax
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run script
run: |
RST_FILE="$(find ./ -name '*.rst')"
mapfile -t RST_FILE <<< "$RST_FILE"
for file in "${RST_FILE[@]}"; do
LINES="$(grep "php occ" "$file")"
if [ -n "$LINES" ]; then
LINES="$(echo "$LINES" | grep -v "sudo -E -u www-data php occ")"
fi
if [ "$(echo "$LINES" | wc -l)" -gt 0 ]; then
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"
echo "See $LINES"
FAIL=1
echo test
fi
done
if [ -n "$FAIL" ]; then
exit 1
fi