Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsimon committed Jun 16, 2022
1 parent 7164555 commit c0ee8db
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
9 changes: 5 additions & 4 deletions options/env.go
Expand Up @@ -37,10 +37,11 @@ const (

// TODO(input): INPUT_ constants should be removed in a future release once
// they have replacements in upstream scorecard.
EnvInputRepoToken = "INPUT_REPO_TOKEN" //nolint:gosec
EnvInputResultsFile = "INPUT_RESULTS_FILE"
EnvInputResultsFormat = "INPUT_RESULTS_FORMAT"
EnvInputPublishResults = "INPUT_PUBLISH_RESULTS"
EnvInputRepoToken = "INPUT_REPO_TOKEN" //nolint:gosec
EnvInputInternalRepoToken = "INPUT_INTERNAL_DEFAULT_TOKEN" //nolint:gosec
EnvInputResultsFile = "INPUT_RESULTS_FILE"
EnvInputResultsFormat = "INPUT_RESULTS_FORMAT"
EnvInputPublishResults = "INPUT_PUBLISH_RESULTS"
)

// Errors
Expand Down
8 changes: 4 additions & 4 deletions options/options.go
Expand Up @@ -143,10 +143,10 @@ func (o *Options) Print() {

func (o *Options) setScorecardOpts() {
o.ScorecardOpts = scopts.New()
// GITHUB_AUTH_TOKEN
_, tokenSet := os.LookupEnv(EnvGithubAuthToken)
if !tokenSet {
inputToken := os.Getenv(EnvInputRepoToken)
// Set GITHUB_AUTH_TOKEN
inputToken := os.Getenv(EnvInputRepoToken)
if inputToken == "" {
inputToken := os.Getenv(EnvInputInternalRepoToken)
os.Setenv(EnvGithubAuthToken, inputToken)
}

Expand Down

0 comments on commit c0ee8db

Please sign in to comment.