Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit c74fbbe

Browse filesBrowse files
committed
Include assets directly in GHRelease
Resolves hub4j#528 Instead of doing a separate request to fetch the assets associated with a release this keeps a local list of the assets that are part of the list releases endpoint. See https://docs.github.com/en/free-pro-team@latest/rest/reference/repos#list-releases
1 parent 3a11b7c commit c74fbbe
Copy full SHA for c74fbbe

File tree

Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+4
-8
lines changed

‎src/main/java/org/kohsuke/github/GHRelease.java

Copy file name to clipboardExpand all lines: src/main/java/org/kohsuke/github/GHRelease.java
+4-8Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
* Release in a github repository.
1616
*
1717
* @see GHRepository#getReleases() GHRepository#getReleases()
18+
* @see GHRepository#listReleases() () GHRepository#listReleases()
1819
* @see GHRepository#createRelease(String) GHRepository#createRelease(String)
1920
*/
2021
public class GHRelease extends GHObject {
@@ -23,6 +24,7 @@ public class GHRelease extends GHObject {
2324

2425
private String html_url;
2526
private String assets_url;
27+
private List<GHAsset> assets;
2628
private String upload_url;
2729
private String tag_name;
2830
private String target_commitish;
@@ -252,15 +254,9 @@ public GHAsset uploadAsset(String filename, InputStream stream, String contentTy
252254
* Gets assets.
253255
*
254256
* @return the assets
255-
* @throws IOException
256-
* the io exception
257257
*/
258-
public List<GHAsset> getAssets() throws IOException {
259-
Requester builder = owner.root.createRequest();
260-
261-
return builder.withUrlPath(getApiTailUrl("assets"))
262-
.toIterable(GHAsset[].class, item -> item.wrap(this))
263-
.toList();
258+
public List<GHAsset> getAssets() {
259+
return assets;
264260
}
265261

266262
/**

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.