Optional 'requires' workflow job. 'or' condition?

Hi,

I am working on having a workflow job that requires 2 jobs, but just 1 of them must be approve in order to trigger the job. So ONE or THE OTHER.

Is it something that can be done?

I couldn’t find any example or logic helping me on that.
Couldn’t figure out how to achieve it using when and or. Don’t think they work like that.

e.g:

  - run_visual_tests:
      <<: *only_pr
      type: approval
      requires:
        - build_storybook
        - build_something_else

I want run_visual_tests to run if build_storybook OR build_something_else are approved. Can be done?
Thanks!

1 Like