phpcs-action
phpcs-action copied to clipboard
Limit to changed files
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.
Will try to implement it a little bit later 👍
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
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.