GitHub Actions: how to target all branches EXCEPT master?

I want to be able to let an action run on any given branch except master. I am aware that there is a prebuilt filter action, but I want the exact opposite. More like GitLab's except keyword. Since