Skip to content

Commit

Permalink
pass ghe url when creating prun on incoming event
Browse files Browse the repository at this point in the history
We didn't pass the GHE URL in the annotations to the watcher when
creating a prun on incoming webhook requests and as a result the watcher
was not able to connect to the GHE instance properly.

Signed-off-by: Chmouel Boudjnah <[email protected]>
  • Loading branch information
chmouel authored and savitaashture committed Dec 11, 2023
1 parent 3053676 commit 18bb994
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/adapter/sinker.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,13 @@ func (s *sinker) processEventPayload(ctx context.Context, request *http.Request)
}

func (s *sinker) processEvent(ctx context.Context, request *http.Request) error {
if s.event.EventType != "incoming" {
// TODO(chmouel): Add E2E Test for incoming test on GHE when #1518 is merged
if s.event.EventType == "incoming" {
if request.Header.Get("X-GitHub-Enterprise-Host") != "" {
s.event.Provider.URL = request.Header.Get("X-GitHub-Enterprise-Host")
s.event.GHEURL = request.Header.Get("X-GitHub-Enterprise-Host")
}
} else {
if err := s.processEventPayload(ctx, request); err != nil {
return err
}
Expand Down

0 comments on commit 18bb994

Please sign in to comment.