From 8c63c7a836ff6013c9d46cb4a7acf1fc525a47ae Mon Sep 17 00:00:00 2001 From: Alconety Date: Thu, 25 Jan 2024 19:16:56 +0100 Subject: [PATCH] Pipeline errors must be an array (#3276) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This PR addresses ``json: cannot unmarshal array into Go struct field Pipeline.errors of type woodpecker.PipelineError`` when executing ``woodpecker-cli pipeline ls X`` According to API schema, pipeline.errors should contain an array Fixes #3119 Co-authored-by: Alberto Alcón --- woodpecker-go/woodpecker/types.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/woodpecker-go/woodpecker/types.go b/woodpecker-go/woodpecker/types.go index 1c495362a..5746c4e4a 100644 --- a/woodpecker-go/woodpecker/types.go +++ b/woodpecker-go/woodpecker/types.go @@ -69,12 +69,12 @@ type ( // Pipeline defines a pipeline object. Pipeline struct { - ID int64 `json:"id"` - Number int64 `json:"number"` - Parent int64 `json:"parent"` - Event string `json:"event"` - Status string `json:"status"` - Errors PipelineError `json:"errors"` + ID int64 `json:"id"` + Number int64 `json:"number"` + Parent int64 `json:"parent"` + Event string `json:"event"` + Status string `json:"status"` + Errors []*PipelineError `json:"errors"` // Deprecated TODO remove in 3.x Enqueued int64 `json:"enqueued_at"` Created int64 `json:"created_at"`