Workflow config with branch filter does not conform to schema

Hello everyone,

I am trying to setup a workflow that will execute tests on any branch, then deploy a beta build using fastlane if it is master branch. The builds and workflow are working without the branch filter, but when I try to add the filter for master branch to the deploy part of the workflow, I get this output:

We weren't able to start this workflow.
Encountered errors trying to create workflows from this config: Config does not conform to schema: {:workflows {:build-and-deploy {:jobs [nil {:deploy {:filters disallowed-key}}]}}}

(Note I am pushing this config code to a branch other than master. I’m not sure how that affects the output). Here is my config.yml:

version: 3

jobs:
  test:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-25-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      #...

  deploy:
    working_directory: ~/code
    docker:
      - image: circleci/android:api-25-alpha
    environment:
      JVM_OPTS: -Xmx3200m
    steps:
      - checkout
      #...

workflows:
  version: 1
  build-and-deploy:
    jobs:
      - test
      - deploy:
          requires:
            - test
          filters:
            branches:
              only: master

I removed most of the steps for privacy reasons, but I think this suffices. I’ve been looking at configurations for a couple hours and can’t see what I’m doing differently.

The Circle CLI says my config is valid and I ran my YAML through a validator online as well. Would love to hear any ideas!

Thanks everyone.

Your overall config specifies CircleCI version 3.0, which does not exist, and your workflows use version 1.0, which is deprecated. Set them both to 2 :smiley:.

Wow, I totally forgot that was the Circle version and bumped it like a script version when I started adding workflows. I feel so silly. Thank you

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.