如何使用 cdk 将 github 存储库与 aws 连接?

Mah*_*han 5 pipeline github amazon-web-services aws-cdk

我正在学习 aws cdk 并尝试创建代码管道。

我在 github 上创建了个人访问密钥并将其保存在 aws 秘密管理器中。

然后在我的 cdk 堆栈中我写了`

pipeline.addStage({
      stageName:"Source",
      actions:[
        new CodePipelineAction.GitHubSourceAction({
          actionName: 'CheckOut',
          owner: 'Mahmood787',
          repo: "aws-pipeline",
          oauthToken: cdk.SecretValue.secretsManager('github2'),
          output:sourceOutput,
          branch:"master" 
        })
      ]
    });
Run Code Online (Sandbox Code Playgroud)

在 cdk 部署上我收到此错误

Webhook 无法在 GitHub 上注册。错误原因:凭据无效 [StatusCode:401,正文:{"message":"Bad credential","documentation_url":"https://docs.github.com/rest"}]

我有什么遗漏的吗?