Skip to content

Dont use a github token if it empty #203

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
9 changes: 6 additions & 3 deletions pkg/ec/lint.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ func LintEmbeddedClusterVersion(specFiles domain.SpecFiles) ([]domain.LintExpres

func checkIfECVersionExists(version string) (*EmbeddedClusterVersion, bool, error) {
url := githubAPIURL + "/repos/replicatedhq/embedded-cluster/releases/tags/%s"
token := os.Getenv("GITHUB_API_TOKEN")
var bearer = "Bearer " + token

rwMutex.RLock()
ecVersion, found := ecVersions[version]
Expand All @@ -99,7 +97,12 @@ func checkIfECVersionExists(version string) (*EmbeddedClusterVersion, bool, erro
if err != nil {
return nil, false, errors.Wrap(err, "failed to create new request")
}
req.Header.Set("Authorization", bearer)

if os.Getenv("GITHUB_API_TOKEN") != "" {
token := os.Getenv("GITHUB_API_TOKEN")
var bearer = "Bearer " + token
req.Header.Set("Authorization", bearer)
}

client := &http.Client{}
resp, err := client.Do(req)
Expand Down
17 changes: 0 additions & 17 deletions skaffold.Dockerfile

This file was deleted.

14 changes: 0 additions & 14 deletions skaffold.yaml

This file was deleted.

Loading