Jenkins 和 GitHub 网络钩子:HTTP 403 [英] Jenkins and GitHub webhook: HTTP 403

查看:41
本文介绍了Jenkins 和 GitHub 网络钩子:HTTP 403的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 GitHub 存储库,我希望通过 post-receive 挂钩将新提交通知 Jenkins.我已经在 J​​enkins 中安装了 GitHub 插件,并允许 Jenkins 管理它自己的钩子 URL.该项目具有正确的 git 存储库 URL,并指示将更改推送到 GitHub 时构建".当我让 GitHub 发送一个测试负载时,我在前面的 Jenkins 的 nginx 网络服务器中找到了这个:

I have a GitHub repository which I would like to have notify Jenkins of new commits via a post-receive hook. I've installed the GitHub plugin into Jenkins and have allowed for Jenkins to manage it's own hook URLs. The project has the correct git repository URL and is instructed to "Build when a change is pushed to GitHub". When I have GitHub send a test payload I find this in the nginx webserver that front's Jenkins:

207.97.227.233 - - [15/Sep/2011:07:36:51 +0000] "POST /github-webhook/ HTTP/1.1" 403 561 "-" "-"

我正在运行 SSL,所以我禁用了它没有任何效果.我是否需要为权限矩阵中的匿名用户提供特殊权限?

I was running SSL so I disabled it to no effect. Do I need to provide special permissions to an anonymous user in the permissions matrix?

请原谅缺少配置文件:我很高兴分享那些可能存在但我不知道分享哪些有用的内容.

Please forgive the lack of configuration files: I'm happy to share those that might exist but I don't know what might be useful to share.

推荐答案

由于我不允许匿名访问,所以我需要为 GitHub 推送创建一个特定用户并授予它整体读取、创建作业和作业读.还需要将身份验证捆绑到 webhook URL 中,如下所示:

As I don't allow anonymous access, it turns out I needed to create a specific user for GitHub pushes and to grant it Overall read, Job create and Job read. It was also necessary to bundle the authentication into the webhook URL, like so:

https://foo:password@jenkins.example.com/github-webhook/

这篇关于Jenkins 和 GitHub 网络钩子:HTTP 403的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆