Skip to content

Commit

Permalink
refactor: MergeYaml argument
Browse files Browse the repository at this point in the history
  • Loading branch information
jevanlingen committed Feb 18, 2025
1 parent 70ddd8b commit 645f319
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/openrewrite/github/AddCronTrigger.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public TreeVisitor<?, ExecutionContext> getVisitor() {
"schedule:%n" +
" - cron: \"%s\"", expression),
true,
null, null, null).getVisitor());
null, null, null, null).getVisitor());
}

static class RandomCronExpression {
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/org/openrewrite/github/SetupJavaCaching.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) {
d = (Yaml.Documents) new MergeYaml("$.jobs..steps[?(@.uses =~ 'actions/setup-java(?:@v.+)?')]",
"" +
"with:\n" +
" cache: 'gradle'", true, null, null, null)
" cache: 'gradle'", true, null, null, null, null)
.getVisitor().visitNonNull(d, ctx);
}
if (!FindKey.find(documents, "$.jobs..steps[?(@.run =~ '.*mvn.*')]").isEmpty()) {
d = (Yaml.Documents) new MergeYaml("$.jobs..steps[?(@.uses =~ 'actions/setup-java(?:@v.+)?')]",
"" +
"with:\n" +
" cache: 'maven'", true, null, null, null)
" cache: 'maven'", true, null, null, null, null)
.getVisitor().visitNonNull(d, ctx);
}
if (d != documents) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public Yaml visitDocuments(Yaml.Documents documents, ExecutionContext ctx) {
" token: " + slackToken + "\n" +
" payload: |\n" +
" channel: \"" + channelName + "\"\n" +
" text: \"" + messageText + "\"\n",
false, null, null, null)
" text: \"" + messageText,
false, null, null, null, null)
.getVisitor().visitNonNull(d, ctx);

d = (Yaml.Documents) new DeleteKey(jsonPath + ".with.channel-id", null)
Expand Down

0 comments on commit 645f319

Please sign in to comment.