Skip to content

Commit ffdbc53

Browse files
authored
Pass build_pull_request_draft (#16)
1 parent 331ef5c commit ffdbc53

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

internal/command/datadog/payload/buildortask.go

+10-6
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,13 @@ import (
1010

1111
type BuildOrTask struct {
1212
Build struct {
13-
ID *int64 `json:"id"`
14-
Status *string `json:"status"`
15-
Branch *string `json:"branch"`
16-
PullRequest *int64 `json:"pullRequest"`
17-
ChangeIDInRepo *string `json:"changeIdInRepo"`
18-
User struct {
13+
ID *int64 `json:"id"`
14+
Status *string `json:"status"`
15+
Branch *string `json:"branch"`
16+
PullRequest *int64 `json:"pullRequest"`
17+
PullRequestDraft *bool `json:"pullRequestDraft"`
18+
ChangeIDInRepo *string `json:"changeIdInRepo"`
19+
User struct {
1920
Username *string `json:"username"`
2021
} `json:"user"`
2122
} `json:"build"`
@@ -48,6 +49,9 @@ func (buildOrTask BuildOrTask) Enrich(header http.Header, evt *datadogsender.Eve
4849
if value := buildOrTask.Build.PullRequest; value != nil {
4950
evt.Tags = append(evt.Tags, fmt.Sprintf("build_pull_request:%d", *value))
5051
}
52+
if value := buildOrTask.Build.PullRequestDraft; value != nil {
53+
evt.Tags = append(evt.Tags, fmt.Sprintf("build_pull_request_draft:%t", *value))
54+
}
5155

5256
initializerUsername := "api"
5357
if value := buildOrTask.Build.User.Username; value != nil {

0 commit comments

Comments
 (0)