I’m trying to build based on the branch is being deployed, to test the idea created a small job that should execute one command if in the correct branch:
version: 2.1 jobs: build: docker: - image: circleci/openjdk:8-jdk working_directory: ~/repo steps: - checkout - when: condition: - equal: [ "circleci_automation", << pipeline.git.branch >> ] steps: - run: ./test.sh
but when I run this I’m getting the error:
Job may be a string reference to another job 2. [#/jobs/build] expected type: String, found: Mapping | | | | | - << pipeline.git.branch >> | | | | | - main | | | | | - equal:
This is how documentation states this should be done, any idea why it’s failing?