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 7, 2021
1 parent 12f934b commit 012e28e
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 @@ -82,9 +82,6 @@ func (h *PullRequest) Handle(ctx context.Context, eventType, deliveryID string,
if err != nil {
return errors.Wrap(err, "failed to fetch configuration")
}
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 @@ -93,6 +90,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 012e28e

Please sign in to comment.