File tree Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Expand file tree Collapse file tree 4 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -95,6 +95,9 @@ type pr struct {
95
95
Merged bool `json:"merged"`
96
96
Created time.Time `json:"created_at"`
97
97
Updated time.Time `json:"updated_at"`
98
+ Labels []struct {
99
+ Name string `json:"name"`
100
+ } `json:"labels"`
98
101
}
99
102
100
103
type reference struct {
@@ -123,6 +126,10 @@ func convertPullRequests(src []*pr) []*scm.PullRequest {
123
126
}
124
127
125
128
func convertPullRequest (src * pr ) * scm.PullRequest {
129
+ var labels []string
130
+ for _ , label := range src .Labels {
131
+ labels = append (labels , label .Name )
132
+ }
126
133
return & scm.PullRequest {
127
134
Number : src .Number ,
128
135
Title : src .Title ,
@@ -138,6 +145,7 @@ func convertPullRequest(src *pr) *scm.PullRequest {
138
145
Merged : src .Merged ,
139
146
Created : src .Created ,
140
147
Updated : src .Updated ,
148
+ Labels : labels ,
141
149
}
142
150
}
143
151
Original file line number Diff line number Diff line change @@ -96,6 +96,9 @@ type pr struct {
96
96
MergedAt null.String `json:"merged_at"`
97
97
CreatedAt time.Time `json:"created_at"`
98
98
UpdatedAt time.Time `json:"updated_at"`
99
+ Labels []struct {
100
+ Name string `json:"name"`
101
+ } `json:"labels"`
99
102
}
100
103
101
104
type prInput struct {
@@ -123,6 +126,10 @@ func convertPullRequestList(from []*pr) []*scm.PullRequest {
123
126
}
124
127
125
128
func convertPullRequest (from * pr ) * scm.PullRequest {
129
+ var labels []string
130
+ for _ , label := range from .Labels {
131
+ labels = append (labels , label .Name )
132
+ }
126
133
return & scm.PullRequest {
127
134
Number : from .Number ,
128
135
Title : from .Title ,
@@ -151,6 +158,7 @@ func convertPullRequest(from *pr) *scm.PullRequest {
151
158
},
152
159
Created : from .CreatedAt ,
153
160
Updated : from .UpdatedAt ,
161
+ Labels : labels ,
154
162
}
155
163
}
156
164
Original file line number Diff line number Diff line change @@ -109,6 +109,7 @@ type pr struct {
109
109
Created time.Time `json:"created_at"`
110
110
Updated time.Time `json:"updated_at"`
111
111
Closed time.Time
112
+ Labels []string `json:"labels"`
112
113
}
113
114
114
115
type changes struct {
@@ -150,6 +151,7 @@ func convertPullRequest(from *pr) *scm.PullRequest {
150
151
},
151
152
Created : from .Created ,
152
153
Updated : from .Updated ,
154
+ Labels : from .Labels ,
153
155
}
154
156
}
155
157
Original file line number Diff line number Diff line change 28
28
Author User
29
29
Created time.Time
30
30
Updated time.Time
31
+ Labels []string
31
32
}
32
33
33
34
// PullRequestInput provides the input fields required for creating a pull request.
You can’t perform that action at this time.
0 commit comments