diff --git a/lib/Enterprise/GiteaAdapter.php b/lib/Enterprise/GiteaAdapter.php index 1fc5d00..5aa9699 100644 --- a/lib/Enterprise/GiteaAdapter.php +++ b/lib/Enterprise/GiteaAdapter.php @@ -273,6 +273,22 @@ class GiteaAdapter implements GitPlatformAdapter string $body = '', array $options = [] ): array { + // Gitea expects label IDs (int64), not names. Resolve if needed. + if (!empty($options['labels']) && is_string($options['labels'][0] ?? null)) { + $labelNames = $options['labels']; + $existing = $this->listLabels($org, $repo); + $nameToId = []; + foreach ($existing as $label) { + $nameToId[$label['name']] = $label['id']; + } + $options['labels'] = []; + foreach ($labelNames as $name) { + if (isset($nameToId[$name])) { + $options['labels'][] = $nameToId[$name]; + } + } + } + $data = array_merge([ 'title' => $title, 'body' => $body,