Automatically Submit Review on PR based on line change

I am teaching assitant on a Python course and we have several exercises with asserts at the end that test the student programmed the function asked properly.

They make a fork of the course repo and then they make their changes on this fork and submit a PR to their fork, then they add the TAs to the PR as reviewers.

Is there an automatic way to check whether the lines containing the asserts were changed?

I know we can use the “files changed” but if they somehow use black or other fancy formatter those lines will probably be changed and it implies a lot of manual work to simply check they are the same.

We are already using GitHub Actions to run Flake8 (Python style enforcement) so if the solution involves actions or bots/apps we are fine.