Skip to content

Commit

Permalink
github: simplify result for getCommit action
Browse files Browse the repository at this point in the history
  • Loading branch information
brig committed Feb 15, 2025
1 parent 734f59d commit 3b076a8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,9 @@ private static Map<String, Object> getCommit(Map<String, Object> in, String gitH
if (defaultBranch != null && ! defaultBranch.trim().isEmpty()) {
data.put("defaultBranch", defaultBranch);
}
return Collections.singletonMap("result", makeResult(data));
// result just for backward compatibility
return Map.of("result", makeResult(data),
"commit", data);
} catch (IOException e) {
throw new RuntimeException("Failed to get commit data: " + e.getMessage());
}
Expand Down Expand Up @@ -1100,6 +1102,7 @@ private static String assertStatusState(Map<String, Object> in) {
return state;
}

@Deprecated
private static Map<String, Object> makeResult(Object data) {
Map<String, Object> m = new HashMap<>();
m.put("ok", true);
Expand Down

0 comments on commit 3b076a8

Please sign in to comment.