首页 > 解决方案 > 用于 Google Cloud Functions 身份验证重定向的 gitHubAutoDeployer

问题描述

我正在尝试使用以下gitHubAutoDeployer提供的功能:

https://github.com/GoogleCloudPlatform/community/blob/master/tutorials/cloud-functions-github-auto-deployer/index.md

我关注了该项目,但在部署并尝试触发它时,我发现对我的 webhook 的响应是 Google OAuth 屏幕(在 GitHub 项目中,转到设置 > Webhook > 最近交付)。我继续在浏览器中使请求交互,以便我可以提供访问权限。提供我的凭据后,我被重定向到以下内容:

<html><head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>403 Forbidden</title>
</head>
<body text=#000000 bgcolor=#ffffff>
<h1>Error: Forbidden</h1>
<h2>Your client does not have permission to get URL <code>/gitHubAutoDeployer</code> from this server.</h2>
<h2></h2>
</body></html>

现在,GitHub 中的最近交付以 302 响应:

Content-Length: 2
Content-Type: text/html
Date: Mon, 30 Mar 2020 15:02:27 GMT
Location: https://accounts.google.com/ServiceLogin?service=ah&amp;passive=true&amp;continue=https://appengine.google.com/_ah/conflogin%3Fcontinue%3Dhttps://us-central1-REDACTED.cloudfunctions.net/gitHubAutoDeployer
Server: Google Frontend
X-Cloud-Trace-Context: d3333e1490ee3ca522c37243673931ed

我究竟做错了什么?有什么想法吗?

更新:我在项目的 GitHub 上打开了一个问题 - 那里有更多信息可用:

https://github.com/GoogleCloudPlatform/community/issues/1202

标签: node.jsgithubgoogle-cloud-platformgoogle-cloud-functionsgithub-webhook

解决方案


我还按照您引用的项目的教程进行操作,得到了相同的结果。

但是,我使用具有持续部署的 Cloud Build实现了预期的行为


推荐阅读