You need to first add the changed files to git staging area, so that the grumphp can run on it.
Reference: https://github.com/phpro/grumphp/blob/v2.x/doc/commands.md#git-hooks