Skip to content
This repository has been archived by the owner on Sep 30, 2024. It is now read-only.

Commit

Permalink
fix(local): panic in sg ci preview (#62928)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhchabran authored May 27, 2024
1 parent 4280a3e commit 75bd631
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions dev/ci/internal/ci/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package ci
import (
"fmt"
"os"
"os/exec"
"strconv"
"strings"
"time"
Expand Down Expand Up @@ -96,8 +97,12 @@ func NewConfig(now time.Time) Config {
changedFiles, err = gitops.GetBranchChangedFiles(baseBranch, commit)
}
} else {
// for testing
commit = "1234567890123456789012345678901234567890"
out, giterr := exec.Command("git", "rev-parse", "HEAD").Output()
if giterr != nil {
panic(err)
}

commit = strings.TrimSpace(string(out))
changedFiles, err = gitops.GetBranchChangedFiles("main", commit)
}

Expand Down

0 comments on commit 75bd631

Please sign in to comment.