MCPcopy Create free account
hub / github.com/cloudbase/garm / getGhOrgWebhook

Function getGhOrgWebhook

test/integration/organizations_test.go:107–122  ·  view source on GitHub ↗
(url, ghToken, orgName string)

Source from the content-addressed store, hash-verified

105}
106
107func getGhOrgWebhook(url, ghToken, orgName string) (*github.Hook, error) {
108 client := getGithubClient(ghToken)
109 ghOrgHooks, _, err := client.Organizations.ListHooks(context.Background(), orgName, nil)
110 if err != nil {
111 return nil, err
112 }
113
114 for _, hook := range ghOrgHooks {
115 hookURL := hook.Config.GetURL()
116 if hookURL == url {
117 return hook, nil
118 }
119 }
120
121 return nil, nil
122}
123
124func (suite *GarmSuite) UninstallOrgWebhook(id string) {
125 t := suite.T()

Calls 2

getGithubClientFunction · 0.50
GetURLMethod · 0.45

Tested by

no test coverage detected