Skip to content

Commit 7ae4034

Browse files
committed
fix github label assignment
1 parent f8ccc7f commit 7ae4034

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

cmd/ctrlc/root/sync/github/pullrequests.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -594,12 +594,11 @@ func initPullRequestMetadata(pr *github.PullRequest, owner, repo string) map[str
594594
metadata["git/changed-files"] = strconv.Itoa(pr.GetChangedFiles())
595595
log.Debug("PR change stats", "number", prNumber, "additions", pr.GetAdditions(), "deletions", pr.GetDeletions(), "files", pr.GetChangedFiles())
596596

597-
// Add labels
597+
labels := make([]string, len(pr.Labels))
598598
for i, label := range pr.Labels {
599-
labelName := label.GetName()
600-
metadata[fmt.Sprintf("git/label/%d", i)] = labelName
601-
log.Debug("Added PR label", "number", prNumber, "index", i, "label", labelName)
599+
labels[i] = label.GetName()
602600
}
601+
metadata["git/labels"] = strings.Join(labels, ",")
603602

604603
log.Debug("Completed PR metadata initialization", "number", prNumber, "metadata_count", len(metadata))
605604
return metadata

0 commit comments

Comments
 (0)