HTTP错误400访问 /github-webhook /.钩子应包含事件类型



我从gitlab调用webhook jenkins并获得以下错误:

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <title>Error 400 Hook should contain event type</title>
    </head>
    <body>
        <h2>HTTP ERROR 400</h2>
        <p>Problem accessing /github-webhook/. Reason:
            <pre>    Hook should contain event type</pre>
        </p>
        <hr>
        <i>
            <small>Powered by Jetty://</small>
        </i>
        <hr/>
    </body>
</html>

我做了什么?我在这里阅读参考文献,但不起作用:

jenkins github插件返回错误400"挂钩应包含事件类型"

为什么我再次要求类似标题:

导致上述解决方案仍然对我不起作用。

我能确定的:

我确定Jenkins可以连接到GitLab,因为我可以手动构建项目" X",而无错误。当我想推到gitlab时,我想自动构建我的问题,并且总是会遇到这个错误。谁能帮我?

看起来您正在使用 gitlab github plugin的webhook( http://jenkins.example.com/github-webhook/(。

您应该使用以下webooks之一(假设您可以安装gitlab钩插件(:

  • http://jenkins.example.com/gitlab/notify_commit
  • http://jenkins.example.com/gitlab/build_now

参考:https://github.com/jenkinsci/gitlab-hook-hook-plugin#build-now-now-hook

最新更新