You probably shouldn’t be committing things that are broken…
With tools like GitHub Actions and some added constraints, it's not always possible. You literally need a commit to trigger the CI workflow and it starts to trash your branch. Besides, aren't we all familiar with git commit -m "typo"?
This is likely saying you shouldn't save a word document that contains spelling mistakes.
Commit yes you absolutely can. Merge to trunk? Probably not, depends on your strategy.
You should be committing things that are broken all the time. Git works great as a persistent navigatible undo buffer, and you should commit every time you're in a state that you might want to return to.