Workaround for path filtering and required checks on GitHub?

Hey everyone,

We are currently facing the problem of having required checks for the SonarCloud analysis, but want to use the GitHub workflow path filter to not run all jobs for every push. Backend and frontend source code are kept in the same repository and we only want to run unit tests for each part based on what paths have been changed in a pull request.

And in short, this doesn’t work with SonarCloud out of the box. I don’t fully understand the internals, but I presume a PR event triggers a started analysis on SonarCloud and then it waits for the CI (we use build analysis) to report a status. When done, SonarCloud reports the check as successful or failed based on quality settings.

First question, can I just skip an ongoing analysis? Didn’t find anything in the documentation about that. In this case we could add code to skip the analysis in case the path doesn’t match.

Second question, did somebody find a workaround for this? Feels like this would be a common problem.