From c9f38e2813aaad818db29204a1b1b728fcf488ca Mon Sep 17 00:00:00 2001 From: oliverpool Date: Wed, 22 May 2024 10:09:58 +0200 Subject: [PATCH] fix: sourcehut_builds preserve unused fields Fix #3820 --- services/webhook/sourcehut/builds.go | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/services/webhook/sourcehut/builds.go b/services/webhook/sourcehut/builds.go index e7501110a2..ef3b6ceed3 100644 --- a/services/webhook/sourcehut/builds.go +++ b/services/webhook/sourcehut/builds.go @@ -265,18 +265,18 @@ func (pc sourcehutConvertor) buildManifest(repo *api.Repository, commitID, gitRe } defer r.Close() var manifest struct { - Image string `yaml:"image"` - Arch string `yaml:"arch,omitempty"` - Packages []string `yaml:"packages,omitempty"` - Repositories map[string]string `yaml:"repositories,omitempty"` - Artifacts []string `yaml:"artifacts,omitempty"` - Shell bool `yaml:"shell,omitempty"` - Sources []string `yaml:"sources"` - Tasks []map[string]string `yaml:"tasks"` - Triggers []string `yaml:"triggers,omitempty"` - Environment map[string]string `yaml:"environment"` - Secrets []string `yaml:"secrets,omitempty"` - Oauth string `yaml:"oauth,omitempty"` + Image yaml.Node `yaml:"image"` + Arch yaml.Node `yaml:"arch,omitempty"` + Packages yaml.Node `yaml:"packages,omitempty"` + Repositories yaml.Node `yaml:"repositories,omitempty"` + Artifacts yaml.Node `yaml:"artifacts,omitempty"` + Shell yaml.Node `yaml:"shell,omitempty"` + Sources []string `yaml:"sources"` + Tasks yaml.Node `yaml:"tasks"` + Triggers yaml.Node `yaml:"triggers,omitempty"` + Environment map[string]string `yaml:"environment"` + Secrets yaml.Node `yaml:"secrets,omitempty"` + Oauth yaml.Node `yaml:"oauth,omitempty"` } if err := yaml.NewDecoder(r).Decode(&manifest); err != nil { msg := fmt.Sprintf("could not decode manifest %q", pc.meta.ManifestPath)