相关疑难解决方法(0)

尝试使用 GitHub 挂钩代码管道时出现 401 错误凭据

我在尝试执行以下操作时收到此错误消息cdk deploy PipelineStack

Webhook could not be registered with GitHub. Error cause: Invalid credentials [StatusCode: 401, 
Body: {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}] 
(Service: AWSCodePipeline; Status Code: 400; Error Code: ValidationException; 
Request ID: dbab7e3e-ed28-42b8-a2d5-7539be32776b; Proxy: null)
Run Code Online (Sandbox Code Playgroud)

为什么我会看到上述错误?

我什至尝试直接验证存储在AWS秘密管理器中的令牌

curl -H "Authorization: token token-stored-in-secretManager" https://api.github.com/users/my-user
Run Code Online (Sandbox Code Playgroud)

并返回200响应。

我的问题类似于How to connect github repo with aws using cdk?

顺便说一句,我的 github 存储库设置为私有而不是公开。不确定这是否重要。

语境

这是我的源代码阶段的 CDK 代码。

Webhook could not be registered with GitHub. Error cause: Invalid credentials [StatusCode: 401, 
Body: {"message":"Bad credentials","documentation_url":"https://docs.github.com/rest"}] 
(Service: AWSCodePipeline; …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services aws-codepipeline

5
推荐指数
1
解决办法
2058
查看次数