Skip to content

Commit

Permalink
fix: the pr checking out is incorrect (#34)
Browse files Browse the repository at this point in the history
Co-authored-by: rick <LinuxSuRen@users.noreply.github.com>
  • Loading branch information
LinuxSuRen and LinuxSuRen committed Jun 12, 2023
1 parent 00af8f4 commit 3406573
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
build:
CGO_ENABLE=0 go build -ldflags "-w -s" -o bin/gogit
CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/gogit
plugin-build:
cd cmd/argoworkflow && CGO_ENABLE=0 go build -ldflags "-w -s" -o bin/gogit-executor-plugin
cd cmd/argoworkflow && CGO_ENABLED=0 go build -ldflags "-w -s" -o bin/gogit-executor-plugin
copy: build
cp bin/gogit /usr/local/bin
test:
Expand All @@ -12,7 +12,7 @@ goreleaser:
image:
docker build . -t ghcr.io/linuxsuren/gogit
build-workflow-executor-gogit:
cd cmd/argoworkflow && CGO_ENABLE=0 go build -ldflags "-w -s" -o ../../bin/workflow-executor-gogit
cd cmd/argoworkflow && CGO_ENABLED=0 go build -ldflags "-w -s" -o ../../bin/workflow-executor-gogit
image-workflow-executor-gogit:
cd cmd/argoworkflow && docker build . -t ghcr.io/linuxsuren/workflow-executor-gogit:dev --build-arg GOPROXY=https://goproxy.io,direct
push-image-workflow-executor-gogit: image-workflow-executor-gogit
Expand Down
3 changes: 1 addition & 2 deletions cmd/checkout.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ func (o *checkoutOption) runE(c *cobra.Command, args []string) (err error) {
}

if err = wd.Checkout(&git.CheckoutOptions{
Create: true,
Branch: plumbing.NewBranchReferenceName(fmt.Sprintf("pr-%d", o.pr)),
Branch: plumbing.ReferenceName(fmt.Sprintf("pr-%d", o.pr)),
}); err != nil && !strings.Contains(err.Error(), "already exists") {
err = fmt.Errorf("unable to checkout git branch: %s, error: %v", o.tag, err)
return
Expand Down

0 comments on commit 3406573

Please sign in to comment.