Protected branches and required status checks

Hi there - we have a matrix of GH actions that run based on the contents of a PR - at its simplest this means we only run frontend tests when there are frontend file changes, and only run backend tests when there are backend file changes.

We have set up a protected branch and would like to force all actions to pass - however GH considers an action that doesn’t run at all as “pending” and refuses to allow merging.

Is there any solution to this, other than turning off checks that may not run.

If a check is mandatory, it needs to “run” (and “pass”).

The workaround is to basically have two checks w/ the same name, one for the “normal case” which does work:

on:
  push:
    paths:
    - ...

  ...
    real work

and one for the exact opposite,

on:
  push:
    paths-ignore:
    - ...

  ...
    true

I can’t find the right reference for it, and, yes, it’s obviously incredibly brittle, since if you ever make a change to the one side you have to make sure to make the exact same change to the other side.