Skip to content

Commit

Permalink
change repo-path default fo release-note generate
Browse files Browse the repository at this point in the history
  • Loading branch information
DannyBrito committed Feb 8, 2024
1 parent b201694 commit 7d433dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
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

0 comments on commit 7d433dd

Please sign in to comment.