Gitlab 如何在单个键值中包含多个锚定?

Gitlab 如何在单个键值中包含多个锚定?,gitlab,yaml,gitlab-ci,Gitlab,Yaml,Gitlab Ci,我正在尝试设置一些依赖于公共文件集的GitLab CI作业。基本上,我有两份清单和三份工作: .list1: only: changes: &list1 - file1 - file2 .list2: only: changes: &list2 - file3 - file4 job1: only: changes: *list1 job2:

我正在尝试设置一些依赖于公共文件集的GitLab CI作业。基本上,我有两份清单和三份工作:

.list1: 
  only:
    changes: &list1
      - file1
      - file2
      
.list2: 
  only:
    changes: &list2
      - file3
      - file4
      
      
job1:
  only:
    changes: *list1
    
job2:
  only:
    changes: *list2
    
job3:
  only:
    changes:
    # How can I include list1 and list2????
  

目前我唯一能做到这一点的方法是手动列出作业3中的所有文件,这意味着我在两个地方维护相同的列表。我是否可以以某种方式将这两个列表都包括在内?

使用CI linter,我发现以下内容似乎有效:

.list1:
  only: 
    changes: &list1 
      file1 ,
      file2

.list2:
  only: 
    changes: &list2 
      file3 ,
      file4


job:
  script:
    - echo "Hello"
  only:
    changes: [ *list1, *list2 ]

实际上,这可能是在创建:
更改:['file1,file2','file3,file4']
这与
['file1','file2','file3','file4']不同。