Pre-commit has it's own CI that does this for you.
But if you're in a private repository, you can just have a job that runs pre-commit. The versions of the pre-commit tests are hard-coded into the config.
There's also a bot that keeps your pre-commit config up to date with the newest released versions of the checks.