Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: the pr checking out is incorrect #34

Merged
merged 1 commit into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@
}

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)),

Check warning on line 129 in cmd/checkout.go

View check run for this annotation

Codecov / codecov/patch

cmd/checkout.go#L129

Added line #L129 was not covered by tests
}); 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
Loading