File tree 1 file changed +15
-0
lines changed
1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -259,6 +259,21 @@ def get_conan_versions_from_purl(purl):
259
259
yield PackageVersion (value = version )
260
260
261
261
262
+ @router .route ("pkg:github/.*" )
263
+ def get_conan_versions_from_purl (purl ):
264
+ """Fetch versions of ``github`` packages using GitHub REST API."""
265
+ purl = PackageURL .from_string (purl )
266
+ response = get_response (
267
+ url = (f"https://api.github.com/repos/{ purl .namespace } /{ purl .name } /releases" ),
268
+ content_type = "json" ,
269
+ )
270
+ for release in response :
271
+ yield PackageVersion (
272
+ value = release ["tag_name" ],
273
+ release_date = dateparser .parse (release ["published_at" ]),
274
+ )
275
+
276
+
262
277
@router .route ("pkg:golang/.*" )
263
278
def get_golang_versions_from_purl (purl ):
264
279
"""Fetch versions of Go "golang" packages from the Go proxy API."""
You can’t perform that action at this time.
0 commit comments