Skip to content

Commit 412cb7c

Browse files
authored
Merge pull request #593 from stevekuznetsov/skuznets/fix-nested-vendor
scripts/bumper: also run `go mod` in nested vendor
2 parents cd4a94a + 15bfa21 commit 412cb7c

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

scripts/bumper/main.go

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,15 @@ func cherryPick(ctx context.Context, logger *logrus.Entry, c commit, commitArgs
499499
withEnv(exec.CommandContext(ctx,
500500
"go", "mod", "verify",
501501
), os.Environ()...),
502+
withDir(withEnv(exec.CommandContext(ctx,
503+
"go", "mod", "tidy",
504+
), os.Environ()...), filepath.Join("staging", c.Repo)),
505+
withDir(withEnv(exec.CommandContext(ctx,
506+
"go", "mod", "vendor",
507+
), os.Environ()...), filepath.Join("staging", c.Repo)),
508+
withDir(withEnv(exec.CommandContext(ctx,
509+
"go", "mod", "verify",
510+
), os.Environ()...), filepath.Join("staging", c.Repo)),
502511
withEnv(exec.CommandContext(ctx,
503512
"make", "generate-manifests",
504513
), os.Environ()...),
@@ -545,6 +554,11 @@ func withEnv(command *exec.Cmd, env ...string) *exec.Cmd {
545554
return command
546555
}
547556

557+
func withDir(command *exec.Cmd, dir string) *exec.Cmd {
558+
command.Dir = dir
559+
return command
560+
}
561+
548562
func getBody(commits []commit, assign []string) string {
549563
lines := []string{
550564
"The staging/ and vendor/ directories have been synchronized from the upstream repositories, pulling in the following commits:",

0 commit comments

Comments
 (0)