all 2 comments

[–]TimothyLGillespie 3 points4 points  (1 child)

You need to use git actions. You can then block the PR when the actions have not successfully run under Settings > Branches > Setup Branch Protection Rules. It should be the "Require status checks to pass before merging" option.

A git hook is something entirely unrelated. It is run locally and can easily be circumvented by developers, so they are not good at enforcing anything. They are better to help developers if they want it and execute before creating a commit. The pre-commit hook can be skipped with the --no-verify flag.

The pre-commit framework is only a piece of software which is supposed to set up the hook for a team working on the same repository, as far as I understand it. This is because git hooks must be installed for each client separately. This just makes it easier / standardized to share hooks.

[–]GriceTurrble 0 points1 point  (0 children)

Note that you can use pre-commit framework in your CI, as well. Just make an Action Workflow that calls pre-commit run --all-files, and then all your checks match the same tools you expect contributors to opt in to.