Skip to content

Commit

Permalink
fix: pass files of a pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
suzuki-shunsuke committed Nov 13, 2023
1 parent 2031a43 commit 4874f70
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion pkg/controller/fix_redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"context"
"fmt"
"net/http"
"path/filepath"

"github.com/aquaproj/registry-tool/pkg/checkrepo"
genrg "github.com/aquaproj/registry-tool/pkg/generate-registry"
Expand Down Expand Up @@ -60,8 +61,14 @@ func (c *Controller) createFixRedirectPR(ctx context.Context, pkgName string, cf
return fmt.Errorf("render a template pr_body: %w", err)
}

pkgDir := filepath.Join("pkgs", filepath.FromSlash(pkgName))
branch := fmt.Sprintf("aqua-registry-updater-transfer-%s-", pkgName)
if err := c.exec(ctx, "ghcp", "commit", "-r", fmt.Sprintf("%s/%s", c.param.RepoOwner, c.param.RepoName), "-b", branch, "-m", prTitle, ""); err != nil {
if err := c.exec(ctx, "ghcp", "commit",
"-r", fmt.Sprintf("%s/%s", c.param.RepoOwner, c.param.RepoName),
"-b", branch, "-m", prTitle,
"registry.yaml",
filepath.Join(pkgDir, "registry.yaml"),
filepath.Join(pkgDir, "pkg.yaml")); err != nil {
return fmt.Errorf("create a branch: %w", err)
}
if _, err := c.createPR(ctx, &ParamCreatePR{
Expand Down

0 comments on commit 4874f70

Please sign in to comment.