Skip to content

Commit

Permalink
Update PR before trying to merge it
Browse files Browse the repository at this point in the history
It probably makes sense to do things in this order rather than how we
were doing it before.
  • Loading branch information
f1sherman committed Apr 8, 2021
1 parent c4ba980 commit 6b18729
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions server/handler/pull_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,6 @@ func (h *PullRequest) Handle(ctx context.Context, eventType, deliveryID string,
if err != nil {
return err
}
if err := h.ProcessPullRequest(ctx, pullCtx, client, config, pr); err != nil {
logger.Error().Err(errors.WithStack(err)).Msg("Error processing pull request")
}

if event.GetAction() == "labeled" || event.GetAction() == "opened" {
base, _ := pullCtx.Branches()
Expand All @@ -79,6 +76,10 @@ func (h *PullRequest) Handle(ctx context.Context, eventType, deliveryID string,
}
}

if err := h.ProcessPullRequest(ctx, pullCtx, client, config, pr); err != nil {
logger.Error().Err(errors.WithStack(err)).Msg("Error processing pull request")
}

return nil
}

Expand Down

0 comments on commit 6b18729

Please sign in to comment.