How do I not run a job instance based on conditional

My Github Actions YAML file looks like this -

jobs:
  build:
    name: ${{ matrix.name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:

        include:
          - name: macos-foo
            os: macos-latest
            compiler: clang

How do I only run this job instance if a certain conditional matches?

For eg, only for a specific branch -

steps:
- uses: nelonoel/branch-name@v1.0.1
- name: Check branch name
  if: $BRANCH_NAME == "bar"
  run: ...

I can cancel the job instance based on a certain conditional, but I want to include the conditional in the matrix itself so that the job instance does not execute at all (as opposed to being cancelled).