From fd2e6e70905101fb42b17314c32fa0080e277aae Mon Sep 17 00:00:00 2001 From: licheng5625 Date: Thu, 9 Feb 2023 16:28:27 +0100 Subject: [PATCH] support github enterprise github enterprise api endpoint is https://github.xxx.xxx/api/v3/repos --- pkg/vendir/fetch/githubrelease/sync.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/vendir/fetch/githubrelease/sync.go b/pkg/vendir/fetch/githubrelease/sync.go index 01393900..00b5d92f 100644 --- a/pkg/vendir/fetch/githubrelease/sync.go +++ b/pkg/vendir/fetch/githubrelease/sync.go @@ -74,7 +74,11 @@ func (d Sync) Desc() (string, error) { } func (d Sync) url() (string, error) { - url := fmt.Sprintf("https://api.github.com/repos/%s/releases", d.opts.Slug) + defaultApiEndpoint = "https://api.github.com" + if len(d.opts.endpoint) > 0: + defaultApiEndpoint = d.opts.endpoint + + url := defaultApiEndpoint + fmt.Sprintf("/repos/%s/releases", d.opts.Slug) switch { case len(d.opts.URL) > 0: