File tree Expand file tree Collapse file tree 4 files changed +43
-5
lines changed
src/main/java/org/kohsuke/github Expand file tree Collapse file tree 4 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 2
2
<modelVersion >4.0.0</modelVersion >
3
3
<groupId >org.kohsuke</groupId >
4
4
<artifactId >cortexapps-github-api</artifactId >
5
- <version >1.322 </version >
5
+ <version >1.323 </version >
6
6
<name >GitHub API for Java</name >
7
7
<url >https://github-api.kohsuke.org/</url >
8
8
<description >GitHub API for Java</description >
Original file line number Diff line number Diff line change @@ -243,11 +243,11 @@ public String getSha() {
243
243
public static class Parent {
244
244
245
245
/** The url. */
246
- @ SuppressFBWarnings (value = "UUF_UNUSED_FIELD " , justification = "We don't provide it in API now " )
247
- String url ;
246
+ @ SuppressFBWarnings (value = "UUF_UNUSED_PUBLIC_OR_PROTECTED_FIELD " , justification = "used in backend code " )
247
+ public String url ;
248
248
249
249
/** The sha. */
250
- String sha ;
250
+ public String sha ;
251
251
}
252
252
253
253
/**
Original file line number Diff line number Diff line change @@ -19,6 +19,16 @@ public final class GHContentBuilder {
19
19
private final Requester req ;
20
20
private String path ;
21
21
22
+ private static final class UserInfo {
23
+ private final String name ;
24
+ private final String email ;
25
+
26
+ private UserInfo (String name , String email ) {
27
+ this .name = name ;
28
+ this .email = email ;
29
+ }
30
+ }
31
+
22
32
/**
23
33
* Instantiates a new GH content builder.
24
34
*
@@ -102,6 +112,34 @@ public GHContentBuilder message(String commitMessage) {
102
112
return this ;
103
113
}
104
114
115
+ /**
116
+ * Configures the author of this content.
117
+ *
118
+ * @param name
119
+ * the name
120
+ * @param email
121
+ * the email
122
+ * @return the gh commit builder
123
+ */
124
+ public GHContentBuilder author (String name , String email ) {
125
+ req .with ("author" , new UserInfo (name , email ));
126
+ return this ;
127
+ }
128
+
129
+ /**
130
+ * Configures the committer of this content.
131
+ *
132
+ * @param name
133
+ * the name
134
+ * @param email
135
+ * the email
136
+ * @return the gh commit builder
137
+ */
138
+ public GHContentBuilder committer (String name , String email ) {
139
+ req .with ("committer" , new UserInfo (name , email ));
140
+ return this ;
141
+ }
142
+
105
143
/**
106
144
* Commits a new content.
107
145
*
Original file line number Diff line number Diff line change @@ -241,7 +241,7 @@ public String getTreeUrl() {
241
241
* @return the parents
242
242
*/
243
243
@ SuppressFBWarnings (value = "EI_EXPOSE_REP" , justification = "acceptable" )
244
- List <GHCommit .Parent > getParents () {
244
+ public List <GHCommit .Parent > getParents () {
245
245
return parents ;
246
246
}
247
247
You can’t perform that action at this time.
0 commit comments