I have a config.yml
file that uses workflows to orchestrate various build jobs. The jobs essentially involve running through unit tests and if successful deploying to our alpha stack and running integration tests against the new deployment. This happens on every commit, the workflow has a few conditional jobs using branch filters to promote successful builds to our production stack if the commit happens on master
.
This behavior is working well for us however we would like to include some additional filters that only deploy to our alpha stack and run integration tests if the branch has an associated open PR.
I know this is possible using the $CIRCLE_PULL_REQUEST
environment variable inside bash scripts however this is not ideal because inside the Circle CI workflow UI we still see the deploy/test alpha jobs even though they will be aborted.
Is it possible to conditionally run jobs in a workflow based off if a branch has a pull request open or not? If not would it be possible using when
or unless
to conditionally run a different workflow depending on if a PR is open or not?
Thanks!