gitea brauchbar

This commit is contained in:
th committed 2026-04-10 15:44:51 +02:00
1 parent dd1afbbeb2
commit 7219bae655
6 files changed
+606 -60

No files matched your search

+33
View File
@@ -159,6 +159,39 @@ class GiteaClient
return is_array($resp) ? $resp : [];
}
/** List milestones for a repo (state: 'open' | 'closed' | 'all'). */
public function listRepoMilestones(string $owner, string $repo, string $state = 'open', int $limit = 100): array
{
$path = '/repos/' . rawurlencode($owner) . '/' . rawurlencode($repo) . '/milestones';
$resp = $this->request('GET', $path, ['state' => $state, 'page' => 1, 'limit' => $limit]);
return is_array($resp) ? $resp : [];
}
/**
* List who can be assigned to issues in this repo. This is the correct
* endpoint for the "assignee picker": it includes the repo owner, org
* members (when the repo is in an org), AND explicit collaborators —
* unlike `/collaborators` which only returns explicit ones.
*/
public function listRepoAssignees(string $owner, string $repo, int $limit = 100): array
{
$path = '/repos/' . rawurlencode($owner) . '/' . rawurlencode($repo) . '/assignees';
$resp = $this->request('GET', $path, ['page' => 1, 'limit' => $limit]);
return is_array($resp) ? $resp : [];
}
/**
* List labels defined at the org level. These are inherited by repos in
* the org but DON'T appear in `/repos/{owner}/{repo}/labels`.
* 404 if the owner is a user (not an org).
*/
public function listOrgLabels(string $org, int $limit = 100): array
{
$path = '/orgs/' . rawurlencode($org) . '/labels';
$resp = $this->request('GET', $path, ['page' => 1, 'limit' => $limit]);
return is_array($resp) ? $resp : [];
}
// ── Low-level request ─────────────────────────────────────────
private function request(string $method, string $path, array $query = [], ?array $payload = null)