fix: revert #1

This commit is contained in:
soulteary 2023-01-09 23:00:00 +08:00
parent 5a3828e4dd
commit 3285d30374
No known key found for this signature in database
GPG key ID: 8107DBA6BC84D986
3 changed files with 11 additions and 20 deletions

View file

@ -816,13 +816,7 @@ func (h *Hooks) LoadFromFile(path string, asTemplate bool) error {
file = buf.Bytes()
}
toJSON, err := yaml.YAMLToJSON(file)
if err != nil {
return err
}
jsonDecoder := json.NewDecoder(bytes.NewBuffer(toJSON))
jsonDecoder.DisallowUnknownFields()
return jsonDecoder.Decode(h)
return yaml.Unmarshal(file, h)
}
// Append appends hooks unless the new hooks contain a hook with an ID that already exists