From ee462aa2150ec824354537120a2a4e492a9e6c7c Mon Sep 17 00:00:00 2001 From: Roberto Losanno Date: Thu, 13 Mar 2025 18:06:18 +0000 Subject: [PATCH] feat: added support for branches --- README.md | 3 ++- management/stack_instance.go | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a674de..6cd7fd8 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,8 @@ if err != nil { stackAuth := management.StackAuth{ ApiKey: "foobar", // Required ManagementToken: "secret", // Optional -}) + Branch: "development", // Optional +} instance, err := client.Stack(stackAuth) if err != nil { diff --git a/management/stack_instance.go b/management/stack_instance.go index fb93fb2..d40c7a7 100644 --- a/management/stack_instance.go +++ b/management/stack_instance.go @@ -13,6 +13,7 @@ type StackInstance struct { type StackAuth struct { ApiKey string ManagementToken string + Branch string } // Stack creates a new StackInstance which can be used for actions on the @@ -39,5 +40,8 @@ func (si *StackInstance) headers() http.Header { } else { header.Add("authtoken", si.client.authToken) } + if si.auth.Branch != "" { + header.Add("branch", si.auth.Branch) + } return header }