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

change repo-path default for release-note generate cmd #3458

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
4 changes: 1 addition & 3 deletions cmd/release-notes/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ package main

import (
"fmt"
"os"
"path/filepath"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -120,7 +118,7 @@ func addGenerateFlags(subcommand *cobra.Command) {
subcommand.PersistentFlags().StringVar(
&opts.RepoPath,
"repo-path",
env.Default("REPO_PATH", filepath.Join(os.TempDir(), "k8s-repo")),
env.Default("REPO_PATH", ""),
"Path to a local Kubernetes repository, used only for tag discovery.",
)

Expand Down
6 changes: 6 additions & 0 deletions pkg/notes/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"errors"
"fmt"
"os"
"path/filepath"
"strings"

"github.com/sirupsen/logrus"
Expand Down Expand Up @@ -194,6 +195,11 @@ func (o *Options) ValidateAndFinish() (err error) {
)
}

// Set RepoPath to <tempdir>/<gh-org>-<gh-repo> if empty
if o.RepoPath == "" {
o.RepoPath = filepath.Join(os.TempDir(), fmt.Sprintf("%s-%s", o.GithubOrg, o.GithubRepo))
}

// Check if we want to automatically discover the revisions
if o.DiscoverMode != RevisionDiscoveryModeNONE {
if err := o.resolveDiscoverMode(); err != nil {
Expand Down
Loading