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:
25
packages/gitea-client/star/ci.star
Normal file
25
packages/gitea-client/star/ci.star
Normal file
@@ -0,0 +1,25 @@
|
||||
# gitea-client — CI status operations
|
||||
|
||||
load("star/http_helpers.star", "gitea_get")
|
||||
|
||||
def get_ci_status(conn, owner, repo, ref):
|
||||
"""Get CI/CD job status for a commit or branch reference."""
|
||||
path = "/repos/" + owner + "/" + repo + "/commits/" + ref + "/status"
|
||||
data = gitea_get(conn, path)
|
||||
if data == None:
|
||||
return None
|
||||
statuses = data.get("statuses", [])
|
||||
items = []
|
||||
for s in statuses:
|
||||
items.append({
|
||||
"context": s.get("context", s.get("name", "")),
|
||||
"state": s.get("state", s.get("status", "")),
|
||||
"description": s.get("description", ""),
|
||||
"target_url": s.get("target_url", ""),
|
||||
})
|
||||
return {
|
||||
"ref": ref,
|
||||
"state": data.get("state", ""),
|
||||
"statuses": items,
|
||||
"count": len(items),
|
||||
}
|
||||
Reference in New Issue
Block a user