How to use expression in "condition" under "when" statement

I want to determine is my branch is master, like this:

- when:
          condition: <<parameters.branchName>> = master
          steps:
            - run: echo "buildtest"

how should i do

or Can I use expression when I transform this parameter?

workflows:
  test-publish:
    jobs:
      - build:
          current-branch: ${CIRCLE_BRANCH}=master

You cannot do expressions in a when stanza in config. You could do this as a conditional in the shell of the command, but we don’t currently have a way to do this on the step itself.

Hi Rey. I think this feature request https://circleci.com/ideas/?idea=CCI-I-216 is what you are looking for. If so, please vote to show interest and track updates.

Feel free to comment to clarify use case or, if it’s not what you are seeing, please open a new feature request.

That looks alot like you’re trying to do the following (which is already there)

workflows:
  test-publish:
    jobs:
      - build:
          filters:
            branches:
              only:
                - master