Conditional Workflows

I am trying to create a conditional workflow that only executes once every night when the following items are met:

  • pipeline is a scheduled pipeline
  • scheduled pipeline matches a specific name
  • the specified branch has a new git revision (changes have been pushed since last)

I have a trigger set to the desired branch in a Scheduled Trigger in my project settings. And now I am trying to configure the CircleCI config.yml file. But I am having a hard time getting the above logic to not cause errors when linting if the config.yml is valid.

The issue is specifically with trying to include and/equal logic with the not logic. I am not sure how to write the logic for the last bullet point where “this pipeline string variable should NOT equal this other pipeline string variable”

Below is my attempt at this logic, but as I said, it fails the valid config check:

workflows:
  version: 3
  deploy_nightly:
    when:
        and:
            - equal: [ scheduled_pipeline, << pipeline.trigger_source >> ]
            - equal: [ "Release Nightly Delivery", << pipeline.schedule.name >> ]
            - not:
                - equal: [ << pipline.git.revision >>, << pipeline.git.base_revision >> ]
    jobs:
        - shared_setup_simulator
        - deploy_release:
            context:
              - some_context

Any help would be greatly appreciated!