Skip to content

Commit 84a97f0

Browse files
committed
fix pr parsing
1 parent 8956f6d commit 84a97f0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/github/repositories.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,9 @@ func GetFileContents(getClient GetClientFn, getRawClient raw.GetRawClientFn, t t
464464

465465
rawOpts := &raw.RawContentOpts{}
466466

467-
if strings.HasPrefix(path, "refs/pull/") {
468-
prNumber, ok := strings.CutPrefix(path, "refs/pull/")
469-
if ok && len(prNumber) > 0 {
467+
if strings.HasPrefix(ref, "refs/pull/") {
468+
prNumber := strings.TrimSuffix(strings.TrimPrefix(ref, "refs/pull/"), "/head")
469+
if len(prNumber) > 0 {
470470
// fetch the PR from the API to get the latest commit and use SHA
471471
githubClient, err := getClient(ctx)
472472
if err != nil {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy