From deec041056d3c715288125aa0fa647b1e9d123ff Mon Sep 17 00:00:00 2001 From: Elliot Forbes Date: Fri, 31 Mar 2023 10:26:12 +0100 Subject: [PATCH] Converts the map from [string]string to [string]interface{} to allow for integer and bool values --- config/commands.go | 1 - config/config.go | 2 +- config/pipeline.go | 6 +++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/config/commands.go b/config/commands.go index 2167e6859..a90f83466 100644 --- a/config/commands.go +++ b/config/commands.go @@ -29,7 +29,6 @@ func (c *ConfigCompiler) getOrgID( optsOrgSlug string, ) (string, error) { if optsOrgID == "" && optsOrgSlug == "" { - fmt.Println("No org id or slug has been provided") return "", nil } diff --git a/config/config.go b/config/config.go index 7d17b75e5..896d2a337 100644 --- a/config/config.go +++ b/config/config.go @@ -64,7 +64,7 @@ type CompileConfigRequest struct { type Options struct { OwnerID string `json:"owner_id,omitempty"` PipelineParameters map[string]interface{} `json:"pipeline_parameters,omitempty"` - PipelineValues map[string]string `json:"pipeline_values,omitempty"` + PipelineValues map[string]interface{} `json:"pipeline_values,omitempty"` } // ConfigQuery - attempts to compile or validate a given config file with the diff --git a/config/pipeline.go b/config/pipeline.go index 09375d918..923630c4e 100644 --- a/config/pipeline.go +++ b/config/pipeline.go @@ -7,7 +7,7 @@ import ( ) // CircleCI provides various `<< pipeline.x >>` values to be used in your config, but sometimes we need to fabricate those values when validating config. -type Values map[string]string +type Values map[string]interface{} // Static typing is bypassed using an empty interface here due to pipeline parameters supporting multiple types. type Parameters map[string]interface{} @@ -31,9 +31,9 @@ func LocalPipelineValues() Values { } } - vals := map[string]string{ + vals := map[string]interface{}{ "id": "00000000-0000-0000-0000-000000000001", - "number": "1", + "number": 1, "project.git_url": gitUrl, "project.type": projectType, "git.tag": git.Tag(),