fix(api): adding issue labels by name attaches both the repo and the org label (#39873)

Fixes #39651

When an org-owned repo has a repo label and an org label with the same
name, `POST`/`PUT /repos/{owner}/{repo}/issues/{index}/labels` with
label names attached both of them.

---------

Signed-off-by: Nazem <214302554+nazem-droubi@users.noreply.github.com>
Co-authored-by: Nazem <214302554+nazem-droubi@users.noreply.github.com>
Co-authored-by: silverwind <me@silverwind.io>
This commit is contained in:
authored and GitHub committed 2026-10-22 20:54:33 +00:00
1 parent 269b116b1b
commit 7448b49aac
5 files changed
+53 -5

No files matched your search

+3 -1
View File
@@ -56,7 +56,9 @@ type EditLabelOption struct {
// IssueLabelsOption a collection of labels
type IssueLabelsOption struct {
// Labels can be a list of integers representing label IDs
// or a list of strings representing label names
// or a list of strings representing label names.
// If a repository label and an organization label share a name,
// the repository label is used.
Labels []any `json:"labels"`
}