Custom branch protection rules based on changes

Hello together,

at the moment we have a quite big repository with a lot of modules. Some of this modules go to production, some of them not. If there is some change in a module, which goes to production, we want to apply a rule, that such change must be tested. We have about 10 Jenkins jobs for unit tests, integration tests and so on. So we applied a rule, that all of them have to pass, before someone would be able to merge the PR. On the otherside, we have some modules, which don´t go to production (e.g. scripts for the performance tests). So basically what we want to achieve is that, if there were some changes only on for performance test scripts, the testing rule will be disabled. In this case we do not want to wait for the testing jobs to test the code, which does not go to production. Is it possible to achieve this with GitHub somehow or we are better with Jenkins?

Kind regards,