Setting up PHPCS in GitLab only on changed files

Image for post
Image for post
git fetch origin master git diff --name-status origin/master | grep '\.php$' | grep -v "^[RD]" | awk '{ print $2 }'
codestyle: stage: testing needs: ["composer"] image: lorisleiva/laravel-docker script: - files=`sh bin/changed.sh` - phpcs --config-set ignore_warnings_on_exit 1 - if [ ! -z ]; then echo $files | xargs phpcs; fi

Written by

PHP Developer, CTO of MonitorBase.com.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store