Skip to content

Commit 3feabeb

Browse files
committed
fix(pullvet): fix issues event parsing
1 parent bceeeb4 commit 3feabeb

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ build/exec:
77
build:
88
go build -o bin/actions ./cmd
99

10+
test/integration:
11+
GITHUB_EVENT_NAME=issues GITHUB_EVENT_PATH=testdata/issues_event.json bin/actions pullvet
12+
1013
test:
1114
go test ./...
1215

event.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@ func CheckSuiteEvent() (*github.CheckSuiteEvent, error) {
6464
return evt.(*github.CheckSuiteEvent), nil
6565
}
6666

67-
func IssueEvent() (*github.IssueEvent, error) {
67+
func IssueEvent() (*github.IssuesEvent, error) {
6868
evt, err := github.ParseWebHook("issues", Event())
6969
if err != nil {
7070
return nil, err
7171
}
72-
return evt.(*github.IssueEvent), nil
72+
return evt.(*github.IssuesEvent), nil
7373
}
7474

7575
func PullRequest() (*github.PullRequest, string, string, error) {
@@ -92,8 +92,8 @@ func PullRequest() (*github.PullRequest, string, string, error) {
9292
}
9393

9494
// This can be a pull_request milestoned/demilestoned events emitted as issue event
95-
owner := issue.Issue.Repository.Owner.GetLogin()
96-
repo := issue.Issue.Repository.GetName()
95+
owner := issue.Repo.Owner.GetLogin()
96+
repo := issue.Repo.GetName()
9797
pull, _, err := client.PullRequests.Get(context.Background(), owner, repo, issue.Issue.GetNumber())
9898
if err != nil {
9999
return nil, "", "", err

0 commit comments

Comments
 (0)