MCPcopy Index your code
hub / github.com/coder/coder / ghListPRsWithLabel

Function ghListPRsWithLabel

scripts/releaser/github.go:78–103  ·  view source on GitHub ↗

ghListPRsWithLabel returns merged PRs targeting the given branch that have a specific label.

(branch, label string)

Source from the content-addressed store, hash-verified

76// ghListPRsWithLabel returns merged PRs targeting the given branch
77// that have a specific label.
78func ghListPRsWithLabel(branch, label string) ([]ghPR, error) {
79 out, err := ghOutput("pr", "list",
80 "--repo", owner+"/"+repo,
81 "--base", branch,
82 "--state", "merged",
83 "--label", label,
84 "--json", "number,title",
85 "--jq", `.[] | "\(.number)\t\(.title)"`,
86 )
87 if err != nil {
88 return nil, err
89 }
90 if out == "" {
91 return nil, nil
92 }
93 var prs []ghPR
94 for _, line := range strings.Split(out, "\n") {
95 parts := strings.SplitN(line, "\t", 2)
96 if len(parts) < 2 {
97 continue
98 }
99 num, _ := strconv.Atoi(parts[0])
100 prs = append(prs, ghPR{Number: num, Title: parts[1]})
101 }
102 return prs, nil
103}
104
105// prMetadata holds labels and author for a merged PR.
106type prMetadata struct {

Callers 1

runReleaseFunction · 0.85

Calls 1

ghOutputFunction · 0.85

Tested by

no test coverage detected