I have the following config.yml:
- persist_to_workspace:
root: ~/project
paths: *build_cache_paths
# for integration tests:
- /home/circleci/cache/Cypress
I'm trying to persist_to_workspace /home/circleci/cache/Cypress. What's wrong with my syntax?
Your
pathskey has the value*build_cache_pathswhich is an alias. That means the value ofpathsis a reference to the node with the anchor&build_cache_paths(assuming it exists).Two lines below, you start a sequence with
-. Generally, a sequence at this level would be the value of a previous implicit key. But in this case it can't be, since the keypathsalready has a value. Hence the error.If your goal is to merge the sequence behind
*build_cache_pathswith the sequence you give below: That is not possible with YAML. YAML is a serialization language, it doesn't implement operations on data (apart from the non-standard merge key<<that is supported by some implementations but only works on mappings, not on sequences).