phpcs-action icon indicating copy to clipboard operation
phpcs-action copied to clipboard

Limit to changed files

Open SamMousa opened this issue 4 years ago • 2 comments

In repositories where PHPCS is just being introduced it can happen that not all files are correct yet. In such cases it would be nice to only test files that are actually touched by this PR.

SamMousa avatar Mar 23 '20 14:03 SamMousa

Will try to implement it a little bit later 👍

chekalsky avatar Mar 23 '20 15:03 chekalsky

This is how I'm currently implementing changed files on a project (currently not using this action but just started looking into how to get annotations):

changed_files="$(curl --request GET \
                      --url https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }}/files \
                      --header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' | jq -r '.[] | select(.status != "removed") | .filename')"

echo "$changed_files" | xargs -rt vendor/bin/phpcs --standard=Magento2

navarr avatar May 08 '20 18:05 navarr

Hey, I've decided to archive this action as there is a better alternative now available. I've created this action in the very early days of Github Actions and now it's time to go.

Migration

chekalsky avatar Sep 08 '22 22:09 chekalsky