Recently, our team has moved the CI from Gitlab CI to Circle. In Gitlab we filter the job by branch, but after configuring the integration with our Gitlab repositories we are noticing that workflows aren’t running as expected and we can’t use neither unless
or when
filter on our workflows due to empty values in parameter << pipeline.git.branch >>
.
Here it is our CI configuration:
workflows:
# ...
main:
unless:
or:
- equal: [main, << pipeline.git.branch >>]
- equal: [develop, << pipeline.git.branch >>]
# ...
deploy-staging:
when:
equal: [develop, << pipeline.git.branch >>]
We add a test job to see the output of pipeline values during the running of push events using the following configuration:
echo-params:
docker:
- image: cimg/base:stable
steps:
- run: |
echo 'tag="<< pipeline.git.tag >>"'
echo 'branch="<< pipeline.git.branch >>"'
echo 'branch-alternative="{ .Branch }"'
echo 'revision="<< pipeline.git.revision >>"'
echo 'base_revision="<< pipeline.git.base_revision >>"'
echo 'trigger_source="<< pipeline.trigger_source >>"'
Although, none of the corresponding values was being set with expected value: