I wanted to save some time on our runners in GitLab and decided to only run phpcs on changed files for that merge request. I also wanted it to run as a git commit hook to try and prevent bad code from even getting pushed up. What I came up with was to add two shell scripts to the repo under the folder bin. changed.sh (chmod u+x) Add the following to your .gitlab-ci.yml changed.sh could just go inside the yml file, but I like using it before deploys.
Newsletter

Get the latest Laravel/PHP jobs, events and curated articles straight to your inbox, once a week

Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge. Glimpse streamlines Laravel development by seamlessly deploying GitHub pull requests to preview environments with the help of Laravel Forge.
Fathom Analytics | Fast, simple and privacy-focused website analytics. Fathom Analytics | Fast, simple and privacy-focused website analytics.
Shirts painstakingly handcrafted by under-caffeinated developers. Shirts painstakingly handcrafted by under-caffeinated developers.
Community Partners