From 6a30d0f6af64db6cc1c3ffdba31069e1e6674689 Mon Sep 17 00:00:00 2001 From: Marc Campbell Date: Tue, 19 Mar 2024 06:37:38 -1000 Subject: [PATCH] Include a header indicating if running from CI --- pkg/platformclient/client.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/platformclient/client.go b/pkg/platformclient/client.go index 9b2e1f066..76902cc6b 100644 --- a/pkg/platformclient/client.go +++ b/pkg/platformclient/client.go @@ -118,6 +118,10 @@ func (c *HTTPClient) DoJSON(method string, path string, successStatus int, reqBo req.Header.Set("Accept", "application/json") req.Header.Set("User-Agent", fmt.Sprintf("Replicated/%s", version.Version())) + if _, ok := os.LookupEnv("CI"); ok { + req.Header.Set("X-Replicated-CI", os.Getenv("CI")) + } + if err := addGitHubActionsHeaders(req); err != nil { return errors.Wrap(err, "add github actions headers") }