Skip to content

chore: Debug

chore: Debug #28

Workflow file for this run

name: PHP Mess Detector
on: push
jobs:
phpmd:
name: PHP Mess Detector
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Setup PHP environment
uses: shivammathur/setup-php@v2
with:
coverage: none
tools: phpmd
- name: Run PHP Mess Detector on modified files
shell: bash
run: |
RETVAL=0
FILELIST=$(mktemp /tmp/phpmd-check.XXXXXX)
mapfile -d ',' -t added_modified_files < <(printf '%s,' '${{ steps.files.outputs.added_modified }}')
for FILE in "${added_modified_files[@]}"; do
EXT="${FILE##*.}"
echo "Changed file: " $FILE ", extension: " $EXT
if [[ "$EXT" == "php" ]]; then
echo "src/${FILE}" >> "${FILELIST}"
echo "File added to the file list: " $FILE
fi
done
echo "FILELIST:" ${FILELIST}
cat ${FILELIST}
cat ${FILELIST} | paste -sd "," -
if [ -s "${FILELIST}" ]; then
FILES=`cat ${FILELIST} | paste -sd "," -`
echo "Running PHPMD on" $FILES
phpmd $FILES github .github/phpmd-ruleset.xml --exclude 'vendor/*'
RETVAL=$?
else
echo "There are no changes in PHP files (no PHP-MD test performed)"
fi
exit $RETVAL