Skip to content

Commit

Permalink
fix lint (#1681)
Browse files Browse the repository at this point in the history
  • Loading branch information
sunkickr authored and kushalmalani committed Jul 23, 2024
1 parent 8ebe111 commit cbbeb97
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 4 additions & 2 deletions astro-client-core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var (
HTTPStatus204 = 204
)

const TrueString = "true"

// a shorter alias
type CoreClient = ClientWithResponsesInterface

Expand Down Expand Up @@ -60,10 +62,10 @@ func CoreRequestEditor(ctx httpContext.Context, req *http.Request) error {
req.URL = requestURL
req.Header.Add("authorization", currentCtx.Token)
switch {
case os.Getenv("DEPLOY_ACTION") == "true" && os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("DEPLOY_ACTION") == TrueString && os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "deploy-action")
req.Header.Add("x-astro-client-version", os.Getenv("DEPLOY_ACTION_VERSION"))
case os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "github-action")
req.Header.Add("x-astro-client-version", version.CurrVersion)
default:
Expand Down
6 changes: 4 additions & 2 deletions astro-client-iam-core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var (
HTTPStatus204 = 204
)

const TrueString = "true"

// a shorter alias
type CoreClient = ClientWithResponsesInterface

Expand Down Expand Up @@ -59,10 +61,10 @@ func CoreRequestEditor(ctx httpContext.Context, req *http.Request) error {
req.URL = requestURL
req.Header.Add("authorization", currentCtx.Token)
switch {
case os.Getenv("DEPLOY_ACTION") == "true" && os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("DEPLOY_ACTION") == TrueString && os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "deploy-action")
req.Header.Add("x-astro-client-version", os.Getenv("DEPLOY_ACTION_VERSION"))
case os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "github-action")
req.Header.Add("x-astro-client-version", version.CurrVersion)
default:
Expand Down
6 changes: 4 additions & 2 deletions astro-client-platform-core/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ var (
HTTPStatus204 = 204
)

const TrueString = "true"

// a shorter alias
type CoreClient = ClientWithResponsesInterface

Expand All @@ -48,10 +50,10 @@ func requestEditor(ctx httpContext.Context, req *http.Request) error {
req.URL = requestURL
req.Header.Add("authorization", currentCtx.Token)
switch {
case os.Getenv("DEPLOY_ACTION") == "true" && os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("DEPLOY_ACTION") == TrueString && os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "deploy-action")
req.Header.Add("x-astro-client-version", os.Getenv("DEPLOY_ACTION_VERSION"))
case os.Getenv("GITHUB_ACTIONS") == "true":
case os.Getenv("GITHUB_ACTIONS") == TrueString:
req.Header.Add("x-astro-client-identifier", "github-action")
req.Header.Add("x-astro-client-version", version.CurrVersion)
default:
Expand Down

0 comments on commit cbbeb97

Please sign in to comment.