Hey,
git diff --check HEAD^ will not work on all commits from PR rendering using it on CI kinda useless.
I don't think there is a way to make it fully generic using git diff unless you make some assumptions like that PRs are always targeting certain branch, but if there is, I would love to know about it.