Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

fix: using the latest commit id in push event to read file content (#7688)

h3n4le9abab470348
diff --git a/backend/server/webhook.go b/backend/server/webhook.go
index aaaa955996..a7e18ed1da 100644
--- a/backend/server/webhook.go
+++ b/backend/server/webhook.go
@@ -1747,7 +1747,7 @@ func (s *Server) readFileContent(ctx context.Context, pushEvent vcs.PushEvent, r
file,
vcs.RefInfo{
RefType: vcs.RefTypeCommit,
- RefName: pushEvent.CommitList[0].ID,
+ RefName: pushEvent.CommitList[len(pushEvent.CommitList)-1].ID,
},
)
if err != nil {