V0.38.4 full composition (#237)
Co-authored-by: gobha <jasafpro@gmail.com> Co-committed-by: gobha <jasafpro@gmail.com>
This commit is contained in:
21
packages/gitea-client/star/repos.star
Normal file
21
packages/gitea-client/star/repos.star
Normal file
@@ -0,0 +1,21 @@
|
||||
# gitea-client — Repository operations
|
||||
|
||||
load("star/http_helpers.star", "gitea_get")
|
||||
|
||||
def get_repos(conn):
|
||||
"""List repositories accessible via the connection."""
|
||||
data = gitea_get(conn, "/repos/search?limit=50&sort=updated")
|
||||
if data == None:
|
||||
return None
|
||||
repos = data if type(data) == "list" else data.get("data", [])
|
||||
out = []
|
||||
for r in repos:
|
||||
out.append({
|
||||
"full_name": r.get("full_name", ""),
|
||||
"name": r.get("name", ""),
|
||||
"owner": r.get("owner", {}).get("login", ""),
|
||||
"description": r.get("description", ""),
|
||||
"html_url": r.get("html_url", ""),
|
||||
"open_issues": r.get("open_issues_count", 0),
|
||||
})
|
||||
return out
|
||||
Reference in New Issue
Block a user