hooks are protected with signed sha

This commit is contained in:
Brad Rydzewski
2015-04-30 14:23:46 -07:00
parent 64cc684295
commit 6fcae7d80a
9 changed files with 59 additions and 21 deletions

View File

@@ -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
}