v2.8.0 WIP: create/upload files + commit history + labels sync
- POST /api/gitea/projects/{owner}/{repo}/upload (binary upload)
- get_file_commits() in GiteaClient
- GET /api/gitea/projects/{owner}/{repo}/commits (per-file history)
- POST .../sync-labels (Gitea labels → FlowDeck tags)
- New file form + upload button in gitea_workspace.html topbar
This commit is contained in:
@@ -386,6 +386,17 @@ class GiteaClient:
|
||||
for k in keys:
|
||||
del self._cache[k]
|
||||
|
||||
async def get_file_commits(self, owner: str, repo: str, path: str) -> list[dict]:
|
||||
"""Get recent commits affecting a specific file."""
|
||||
url = f"{self.base}/api/v1/repos/{owner}/{repo}/commits"
|
||||
params = {"path": path, "limit": 20}
|
||||
headers = {"Authorization": f"token {self.token[0] if self.token else ''}", "Accept": "application/json"}
|
||||
async with httpx.AsyncClient(timeout=self.timeout) as client:
|
||||
resp = await client.get(url, params=params, headers=headers)
|
||||
if resp.status_code == 200:
|
||||
return resp.json()
|
||||
return []
|
||||
|
||||
|
||||
# ── singleton ──
|
||||
|
||||
|
||||
Reference in New Issue
Block a user