Pipeline Variables not valid in Orbs?

I’m trying to use the following in an orb command

  - when:
        equal: [ master, << pipeline.git.branch >> ]

However when I try to validate it I’m getting

Error: Error calling command: 'command-name'
Unknown variable(s): branch

Are pipeline variables not valid in orbs ?

Pipeline variables are not in scope in orbs - https://circleci.com/docs/2.0/pipeline-variables/#the-scope-of-pipeline-parameters

You can declare parameters to the orb and pass the values in that way.