Skip to content

Commit dba284b

Browse files
authored
Merge pull request #226 from daanvandenhoek/patch-1
Added Latest Release for repository
2 parents 4196991 + 8f2e5d6 commit dba284b

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib/src/common/repos_service.dart

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -942,6 +942,18 @@ class RepositoriesService extends Service {
942942
);
943943
}
944944

945+
/// Lists the latest release for the specified repository.
946+
///
947+
/// API docs: https://developer.github.com/v3/repos/releases/#get-the-latest-release
948+
Future<Release> getLatestRelease(RepositorySlug slug) {
949+
ArgumentError.checkNotNull(slug);
950+
return github.getJSON<Map<String, dynamic>, Release>(
951+
'/repos/${slug.fullName}/releases/latest',
952+
convert: (i) => Release.fromJson(i),
953+
statusCode: StatusCodes.OK,
954+
);
955+
}
956+
945957
/// Fetches a single release by the release ID.
946958
///
947959
/// API docs: https://developer.github.com/v3/repos/releases/#get-a-single-release

0 commit comments

Comments
 (0)