【问题标题】:Provisioning GitHub-backed CodePipeline using CloudFormation使用 CloudFormation 供应 GitHub 支持的 CodePipeline
【发布时间】:2017-08-03 22:26:00
【问题描述】:

我正在尝试使用 CloudFormation 创建我的 CodePipeline。我遇到的问题是,一旦它被创建并尝试运行,它立即给我错误:

无效的操作配置 GitHub 存储库“MyOrg/MyRepo”或 分支“MyBranch”不存在。

事实上他们都这样做了。我可以单击编辑,选择我的源代码控制,连接到 GitHub,然后选择确切的存储库和分支,它工作正常。但是当直接在管道的 CloudFormation 配置之后启动管道时,它总是给我这个错误。

我使用 aws codepipeline get-pipeline 导出了使用 CloudFormation 的新配置管道的管道配置 JSON,然后在使用“连接到 GitHub”更新控制台中的配置后立即再次执行此操作,两者都是相同的。

【问题讨论】:

    标签: github amazon-cloudformation aws-codepipeline


    【解决方案1】:

    确保 CodePipeline 的 GitHub 源操作的 Configuration 属性包含 documentation 中列出的所有四个必需属性:

    • Owner
    • Repo
    • Branch
    • OAuthToken

    仔细检查您提供的值是否正确,尤其是OAuthToken,它近似于基于 AWS 控制台的 CodePipeline 设置中的“连接到 GitHub”步骤。

    要从 GitHub 获取有效的 OAuthToken 以在此处输入,您需要 create a New personal access token 并启用 repoadmin:repo_hook 范围,如 documentation troubleshooting 页面中所述。

    【讨论】:

    • 问题是我的令牌权限:我启用了“admin:repo_hook”但没有启用“repo”。
    猜你喜欢
    • 2023-03-19
    • 1970-01-01
    • 1970-01-01
    • 2017-05-26
    • 2021-09-29
    • 1970-01-01
    • 2019-07-28
    • 2021-04-19
    • 2019-01-06
    相关资源
    最近更新 更多