Skip to content

Commit

Permalink
Handle the ready_for_review event type
Browse files Browse the repository at this point in the history
  • Loading branch information
cket committed Apr 21, 2020
1 parent de8ab54 commit be1f9bb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/events/event_parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,10 @@ func (e *EventParser) ParseGithubPullEvent(pullEvent *github.PullRequestEvent) (
switch pullEvent.GetAction() {
case "opened":
pullEventType = models.OpenedPullEvent
case "ready_for_review":
// when an author takes a PR out of 'draft' state a 'ready_for_review'
// event is triggered. We want atlantis to treat this as a freshly opened PR
pullEventType = models.OpenedPullEvent
case "synchronize":
pullEventType = models.UpdatedPullEvent
case "closed":
Expand Down
4 changes: 4 additions & 0 deletions server/events/event_parser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,10 @@ func TestParseGithubPullEvent_EventType(t *testing.T) {
action: "reopened",
exp: models.OtherPullEvent,
},
{
action: "ready_for_review",
exp: models.OpenedPullEvent,
},
}

for _, c := range cases {
Expand Down

0 comments on commit be1f9bb

Please sign in to comment.