Skip to content

Commit 0ab6cc0

Browse files
committed
attempt issue ID parsing from pull request section
1 parent a49a1fa commit 0ab6cc0

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

bot/connector/github/builder.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,11 @@ func (builder *eventDataBuilder) readPayload(context *builderContext, r *http.Re
6262
}
6363

6464
func (builder *eventDataBuilder) readFromJson(context *builderContext, payload *payload) {
65-
context.data.number = payload.Number
65+
if payload.PullRequest.Number > 0 {
66+
context.data.number = payload.PullRequest.Number
67+
} else {
68+
context.data.number = payload.Number
69+
}
6670
context.data.title = payload.PullRequest.Title
6771
context.data.changedFiles = payload.PullRequest.ChangedFiles
6872
context.data.additions = payload.PullRequest.Additions

bot/connector/github/json.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package github
22

33
type pullRequestSection struct {
4+
Number int `json:"number"`
45
State string `json:"state"`
56
Title string `json:"title"`
67
Commits int `json:"commits"`

0 commit comments

Comments
 (0)