Is it possible to use a logic statement when calling a job within a workflow? For example:
myjob: when: << pipeline.parameters.job_parameter >> # this works jobs: - checkout_code: executor: executor filters: branches: only: testbranch when: # this does not work condition: equal: [ "develop", << pipeline.parameters.job_env >> ]
The use case here is that I am attempting to trigger a pipeline via a webhook in another app, however I only want it to trigger when a certain environment string is passed as a parameter in the payload. This way I can trigger builds with different contexts, depending on the environment passed. As of right now, running
circleci config validate tells me that the second
when is an unexpected argument. Is there a way to get this to work? Or do I have to create a separate workflow for each environment?