mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2026-04-15 01:41:56 +00:00
hooks are protected with signed sha
This commit is contained in:
@@ -172,7 +172,7 @@ func GetHook(client *github.Client, owner, name, url string) (*github.Hook, erro
|
||||
return nil, err
|
||||
}
|
||||
for _, hook := range hooks {
|
||||
if hook.Config["url"] == url {
|
||||
if strings.HasPrefix(hook.Config["url"].(string), url) {
|
||||
return &hook, nil
|
||||
}
|
||||
}
|
||||
@@ -255,6 +255,9 @@ func DeleteKey(client *github.Client, owner, name, title string) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if k == nil {
|
||||
return nil
|
||||
}
|
||||
_, err = client.Repositories.DeleteKey(owner, name, *k.ID)
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user