Skip to content

Commit 34dd595

Browse files
alan-agius4clydin
authored andcommitted
ci: use conditional statments instead of bash script
See: https://circleci.com/docs/configuration-reference#logic-statements (cherry picked from commit d9b8a1d)
1 parent 14f7760 commit 34dd595

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

.circleci/dynamic_config.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -382,12 +382,15 @@ workflows:
382382
nodeversion: '16.10'
383383
snapshots: true
384384
pre-steps:
385-
- run:
386-
name: Check if e2e snapshots should be executed.
387-
command: >
388-
if [[ "<<pipeline.parameters.snapshot_changed>>" != "true" ]] && [[ -n "{$CIRCLE_PULL_REQUEST}" ]]; then
389-
circleci-agent step halt
390-
fi
385+
- when:
386+
condition:
387+
and:
388+
- not:
389+
equal: [main, << pipeline.git.branch >>]
390+
- not: << pipeline.parameters.snapshot_changed >>
391+
steps:
392+
# Don't run snapshot E2E's unless it's on the main branch or the snapshots file has been updated.
393+
- run: circleci-agent step halt
391394
requires:
392395
- build
393396
filters:

0 commit comments

Comments
 (0)