mirror of
https://github.com/adnanh/webhook.git
synced 2025-10-04 21:51:02 +00:00
fix: revert #1
This commit is contained in:
parent
5a3828e4dd
commit
3285d30374
3 changed files with 11 additions and 20 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue