Skip to content

Commit

Permalink
fix(create-pr-new-pkg): stop checkout branch and create a commit (#731)
Browse files Browse the repository at this point in the history
* fix(create-pr-new-pkg): stop checkout branch and create a commit

* chore: fix a lint error
  • Loading branch information
suzuki-shunsuke authored May 29, 2024
1 parent eb02792 commit 1c274db
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/create-pr-new-pkg/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
//go:embed pr_template.md
var bodyTemplate []byte

func CreatePRNewPkgs(ctx context.Context, pkgNames ...string) error { //nolint:cyclop
func CreatePRNewPkgs(ctx context.Context, pkgNames ...string) error {
if len(pkgNames) == 0 {
return errors.New(`usage: $ aqua-registry create-pr-new-pkg <pkgname>...
e.g. $ aqua-registry create-pr-new-pkg cli/cli`)
Expand All @@ -43,7 +43,6 @@ e.g. $ aqua-registry create-pr-new-pkg cli/cli`)
return err
}
}
commitMsg := strings.Join(bodies, "\n")
body := strings.Join(append(bodies, []string{ //nolint:makezero
"",
"```console",
Expand All @@ -57,16 +56,6 @@ e.g. $ aqua-registry create-pr-new-pkg cli/cli`)
if err := initcmd.Init(ctx); err != nil {
return err //nolint:wrapcheck
}
if err := command(ctx, "git", "checkout", "-b", branch); err != nil {
return err
}
if err := command(ctx, "git", "commit", "-m", strings.Join([]string{
"feat: add " + pkgName,
"",
commitMsg,
}, "\n")); err != nil {
return err
}
if err := command(ctx, "git", "push", "origin", branch); err != nil {
return err
}
Expand Down

0 comments on commit 1c274db

Please sign in to comment.