Skip to content

Commit

Permalink
Bump golang.org/x/oauth2 from 0.23.0 to 0.24.0 (#464)
Browse files Browse the repository at this point in the history
Signed-off-by: Manish Gupta <[email protected]>
  • Loading branch information
dependabot[bot] authored and mguptahub committed Nov 22, 2024
1 parent 9002e21 commit a186fe9
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ Flags:
-t, --token string GitHub Auth Token
--make-release-latest bool Mark the created GitHub release as 'latest' (default "true")
--packages-with-index Host the package files in the GitHub Pages branch
--prerelease Mark this release as 'Pre-release' (default: false)

Global Flags:
--config string Config file (default is $HOME/.cr.yaml)
Expand Down
1 change: 1 addition & 0 deletions cr/cmd/upload.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,5 @@ func init() {
uploadCmd.Flags().Bool("push", false, "Push the chart package to the GitHub Pages branch (must not be set if --pr is set)")
uploadCmd.Flags().Bool("pr", false, "Create a pull request for the chart package against the GitHub Pages branch (must not be set if --push is set)")
uploadCmd.Flags().Bool("packages-with-index", false, "Host the package files in the GitHub Pages branch")
uploadCmd.Flags().Bool("prerelease", false, "Mark this as 'Pre-release' (default: false)")
}
1 change: 1 addition & 0 deletions doc/cr_upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ cr upload [flags]
--packages-with-index Host the package files in the GitHub Pages branch
--pages-branch string The GitHub pages branch (default "gh-pages")
--pr Create a pull request for the chart package against the GitHub Pages branch (must not be set if --push is set)
--prerelease Mark this as 'Pre-release' (default: false)
--push Push the chart package to the GitHub Pages branch (must not be set if --pr is set)
--release-name-template string Go template for computing release names, using chart metadata (default "{{ .Name }}-{{ .Version }}")
--release-notes-file string Markdown file with chart release notes. If it is set to empty string, or the file is not found, the chart description will be used instead. The file is read from the chart package
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.19.0
github.com/stretchr/testify v1.9.0
golang.org/x/oauth2 v0.23.0
golang.org/x/oauth2 v0.24.0
helm.sh/helm/v3 v3.16.2
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLL
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.26.0 h1:soB7SVo0PWrY4vPW/+ay0jKDNScG2X9wFeYlXIvJsOQ=
golang.org/x/net v0.26.0/go.mod h1:5YKkiSynbBIh3p6iOc/vibscux0x38BZDkn8sCUPxHE=
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/oauth2 v0.24.0 h1:KTBBxWqUa0ykRPLtV69rRto9TLXcqYkeswu48x/gvNE=
golang.org/x/oauth2 v0.24.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
1 change: 1 addition & 0 deletions pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ type Options struct {
GenerateReleaseNotes bool `mapstructure:"generate-release-notes"`
MakeReleaseLatest bool `mapstructure:"make-release-latest"`
PackagesWithIndex bool `mapstructure:"packages-with-index"`
Prerelease bool `mapstructure:"prerelease"`
}

func LoadConfiguration(cfgFile string, cmd *cobra.Command, requiredFlags []string) (*Options, error) {
Expand Down
2 changes: 2 additions & 0 deletions pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type Release struct {
Commit string
GenerateReleaseNotes bool
MakeLatest string
Prerelease bool
}

type Asset struct {
Expand Down Expand Up @@ -111,6 +112,7 @@ func (c *Client) CreateRelease(_ context.Context, input *Release) error {
TargetCommitish: &input.Commit,
GenerateReleaseNotes: &input.GenerateReleaseNotes,
MakeLatest: &input.MakeLatest,
Prerelease: &input.Prerelease,
}

release, _, err := c.Repositories.CreateRelease(context.TODO(), c.owner, c.repo, req)
Expand Down
4 changes: 2 additions & 2 deletions pkg/releaser/releaser.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,8 @@ func (r *Releaser) UpdateIndexFile() (bool, error) {
// if pages-index-path doesn't end with index.yaml we can try and fix it
if filepath.Base(r.config.PagesIndexPath) != "index.yaml" {
// if path is a directory then add index.yaml
if stat, err := os.Stat(filepath.Join(worktree, r.config.PagesIndexPath)); err == nil && stat.IsDir() {
if err := os.MkdirAll(filepath.Join(worktree, r.config.PagesIndexPath), 0755); err == nil {
r.config.PagesIndexPath = filepath.Join(r.config.PagesIndexPath, "index.yaml")
// otherwise error out
} else {
fmt.Printf("pages-index-path (%s) should be a directory or a file called index.yaml\n", r.config.PagesIndexPath)
os.Exit(1) // nolint: gocritic
Expand Down Expand Up @@ -323,6 +322,7 @@ func (r *Releaser) CreateReleases() error {
Commit: r.config.Commit,
GenerateReleaseNotes: r.config.GenerateReleaseNotes,
MakeLatest: strconv.FormatBool(r.config.MakeReleaseLatest),
Prerelease: r.config.Prerelease,
}
provFile := fmt.Sprintf("%s.prov", p)
if _, err := os.Stat(provFile); err == nil {
Expand Down
7 changes: 7 additions & 0 deletions pkg/releaser/releaser_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ func (f *FakeGitHub) GetRelease(ctx context.Context, tag string) (*github.Releas
URL: "https://myrepo/charts/third-party-file-0.1.0.txt",
},
},
Prerelease: false,
}
return release, nil
}
Expand Down Expand Up @@ -362,6 +363,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
version string
commit string
latest string
prerelease bool
Releaser *Releaser
error bool
}{
Expand All @@ -378,6 +380,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
Commit: "",
PackagesWithIndex: false,
MakeReleaseLatest: true,
Prerelease: false,
},
},
error: true,
Expand All @@ -395,6 +398,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
Commit: "",
PackagesWithIndex: false,
MakeReleaseLatest: true,
Prerelease: false,
},
},
error: false,
Expand All @@ -412,6 +416,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
Commit: "5e239bd19fbefb9eb0181ecf0c7ef73b8fe2753c",
PackagesWithIndex: false,
MakeReleaseLatest: true,
Prerelease: false,
},
},
error: false,
Expand All @@ -430,6 +435,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
PackagesWithIndex: true,
Push: true,
MakeReleaseLatest: true,
Prerelease: false,
},
},
error: false,
Expand Down Expand Up @@ -466,6 +472,7 @@ func TestReleaser_CreateReleases(t *testing.T) {
assert.Equal(t, assetPath, fakeGitHub.release.Assets[0].Path)
assert.Equal(t, tt.commit, fakeGitHub.release.Commit)
assert.Equal(t, tt.latest, fakeGitHub.release.MakeLatest)
assert.Equal(t, tt.prerelease, fakeGitHub.release.Prerelease)
assert.Equal(t, tt.Releaser.config.Commit, fakeGitHub.release.Commit)
fakeGitHub.AssertNumberOfCalls(t, "CreateRelease", 1)
}
Expand Down

0 comments on commit a186fe9

Please sign in to comment.