From 3e01bb1def37e663caeeef7188660e0472d01f4b Mon Sep 17 00:00:00 2001 From: Ksenia Bobrova Date: Fri, 12 Dec 2025 12:38:59 +0100 Subject: [PATCH] Fix comment --- pkg/github/repositories.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/github/repositories.go b/pkg/github/repositories.go index 6b535402..58ecaf5a 100644 --- a/pkg/github/repositories.go +++ b/pkg/github/repositories.go @@ -612,13 +612,11 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t ref = rawOpts.SHA } - // If the path is (most likely) not to be a directory, we will - // first try to get the raw content from the GitHub raw content API. - var rawAPIResponseCode int - // First, get file info from Contents API to retrieve SHA var fileSHA string opts := &github.RepositoryContentGetOptions{Ref: ref} + + // Always call GitHub Contents API first to get metadata including SHA and determine if it's a file or directory fileContent, dirContent, respContents, err := client.Repositories.GetContents(ctx, owner, repo, path, opts) if respContents != nil { defer func() { _ = respContents.Body.Close() }()