1 parent
b81e86b640
commit
b86ae38b03
8 files changed
+393
-2
No files matched your search
@@ -0,0 +1,17 @@
|
||||
"""Thin, agnostic client for the Gitea Actions API.
|
||||
|
||||
Only reads what's needed to build a build/deploy status report: the jobs
|
||||
and steps of a single workflow run.
|
||||
"""
|
||||
|
||||
from typing import Any
|
||||
|
||||
|
||||
def fetch_run_jobs(base_url: str, token: str, owner: str, repo: str, run_id) -> list[dict[str, Any]]:
|
||||
"""Get a Gitea Action job state"""
|
||||
import requests
|
||||
|
||||
url = f"{base_url}/api/v1/repos/{owner}/{repo}/actions/runs/{run_id}/jobs"
|
||||
response = requests.get(url, headers={"Authorization": f"token {token}"}, timeout=10)
|
||||
response.raise_for_status()
|
||||
return response.json()["jobs"]
|
||||
Reference in new issue
Block a user