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

Commit

Permalink
ci: fix git ref
Browse files Browse the repository at this point in the history
Signed-off-by: Mark Sagi-Kazar <[email protected]>
  • Loading branch information
sagikazarmark committed Jan 9, 2024
1 parent b34807f commit eacbe6b
Showing 1 changed file with 3 additions and 18 deletions.
21 changes: 3 additions & 18 deletions ci/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ func New(
// Checkout the repository and use that as the source directory instead of the local one.
checkout Optional[bool],

// Commit hash to check out.
// commit Optional[string],

// Ref to check out.
ref Optional[string],

Expand All @@ -53,26 +50,14 @@ func New(
var source *Directory

if checkout.GetOr(false) {
// c, ok := commit.Get()
// if !ok {
// return nil, errors.New("commit is required when --checkout option is set")
// }

// source = dag.Git("https://github.com/openmeterio/benthos-openmeter.git", GitOpts{
// KeepGitDir: true,
// }).Commit(c).Tree()

r, ok := ref.Get()
if !ok {
return nil, errors.New("ref is required when --checkout option is set")
}

source = dag.Supergit().
Repository().
WithRemote("origin", "https://github.com/openmeterio/benthos-openmeter.git").
WithGitCommand([]string{"pull", "origin", r}).Worktree()
// Commit(c).Tree()

source = dag.Git("https://github.com/openmeterio/benthos-openmeter.git", GitOpts{
KeepGitDir: true,
}).Branch(r).Tree()
} else {
source = projectDir()
}
Expand Down

0 comments on commit eacbe6b

Please sign in to comment.