MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / deleteProjectHook

Function deleteProjectHook

cmd/delete_project_hook.go:54–73  ·  view source on GitHub ↗
(hook string, project string)

Source from the content-addressed store, hash-verified

52}
53
54func deleteProjectHook(hook string, project string) error {
55 git, err := newGitlabClient()
56 if err != nil {
57 return err
58 }
59 hid, err := strconv.Atoi(hook)
60 if err != nil {
61 return err
62 }
63 projectInfo, _, err := git.Projects.GetProject(project)
64 if err != nil {
65 return err
66 }
67 _, err = git.Projects.DeleteProjectHook(projectInfo.ID, hid)
68 if err != nil {
69 return err
70 }
71 fmt.Printf("project hook with id (%d) from (%s) has been deleted\n", hid, projectInfo.PathWithNamespace)
72 return nil
73}

Callers 1

Calls 1

newGitlabClientFunction · 0.85

Tested by

no test coverage detected