diff --git a/cli/internal/ci/ci.go b/cli/internal/ci/ci.go index bcc56f95ed2e3..a22ad78d2d534 100644 --- a/cli/internal/ci/ci.go +++ b/cli/internal/ci/ci.go @@ -16,6 +16,11 @@ func Name() string { return Info().Name } +// Constant returns the name of the CI vendor as a constant +func Constant() string { + return Info().Constant +} + // Info returns information about a CI vendor func Info() Vendor { // check both the env var key and value diff --git a/cli/internal/client/client.go b/cli/internal/client/client.go index 534fc7684c5e5..462ebbed2a029 100644 --- a/cli/internal/client/client.go +++ b/cli/internal/client/client.go @@ -283,7 +283,7 @@ func (c *ApiClient) PutArtifact(hash string, artifactBody []byte, duration int, } req.Header.Set("User-Agent", c.UserAgent()) if ci.IsCi() { - req.Header.Set("x-artifact-client-ci", ci.Name()) + req.Header.Set("x-artifact-client-ci", ci.Constant()) } if tag != "" { req.Header.Set("x-artifact-tag", tag) @@ -403,7 +403,7 @@ func (c *ApiClient) RecordAnalyticsEvents(events []map[string]interface{}) error } req.Header.Set("User-Agent", c.UserAgent()) if ci.IsCi() { - req.Header.Set("x-artifact-client-ci", ci.Name()) + req.Header.Set("x-artifact-client-ci", ci.Constant()) } resp, err := c.HttpClient.Do(req) if resp != nil && resp.StatusCode != http.StatusOK && resp.StatusCode != http.StatusCreated {