It is unclear to me if MergeYaml can do this. I tried a couple of combinations and they did not work for me
Input :
@Test
void testMerging() {
rewriteRun(
spec -> spec
.expectedCyclesThatMakeChanges(2)
.recipe(new MergeYaml(
"$.testing",
"""
table:
- name: jdk_version
value: [ 18 ]
""",
true,
null,
"name"
)),
yaml(
"""
testing:
table:
- name: jdk_version
value: [ 17 ]
""",
"""
testing:
table:
- name: jdk_version
value: [17,18]
"""
)
);
}
Related : openrewrite/rewrite-github-actions#40
It is unclear to me if
MergeYamlcan do this. I tried a couple of combinations and they did not work for meInput :
Related : openrewrite/rewrite-github-actions#40