gpt4 book ai didi

github - AWS CodePipeline github webhook 未在提交时触发

转载 作者:行者123 更新时间:2023-12-04 11:02:37 24 4
gpt4 key购买 nike

我设置了一个 AWS CodePipeline,它使用 github 作为源,使用 CodeBuild 进行构建,并部署到 ElasticBeanstalk。

当一切都在控制台中设置并且我是 github 帐户的管理员时,我能够让它工作(我使用不同的帐户进行测试)

我需要部署的实际代码属于我不是管理员的帐户,因此请关注 this guide我收到了个人访问 token 并使用 CLI 更新了 CodePipeline。

一旦我使用 cli 更新了项目,提交代码时就不再触发它。

我不确定发生了什么变化,因为即使我使用控制台并将 webhook 直接设置为我正在测试的 github 帐户的管理员,它仍然不起作用。

这是我更新管道的json:

{
"pipeline": {
"roleArn": "arn:aws:iam::xxxxxxx:role/service-role/AWSCodePipelineServiceRole-us-west-2-xxxxx-xxxx",
"stages": [
{
"name": "Source",
"actions": [
{
"inputArtifacts": [],
"name": "Source",
"actionTypeId": {
"category": "Source",
"owner": "ThirdParty",
"version": "1",
"provider": "GitHub"
},
"outputArtifacts": [
{
"name": "SourceArtifact"
}
],
"configuration": {
"Owner": "xxx",
"Repo": "xxx",
"PollForSourceChanges": "false",
"Branch": "stage"
},
"runOrder": 1
}
]
},
{
"name": "Build",
"actions": [
{
"inputArtifacts": [
{
"name": "SourceArtifact"
}
],
"name": "Build",
"actionTypeId": {
"category": "Build",
"owner": "AWS",
"version": "1",
"provider": "CodeBuild"
},
"outputArtifacts": [
{
"name": "BuildArtifact"
}
],
"configuration": {
"ProjectName": "xxx-stage-codebuild"
},
"runOrder": 1
}
]
},
{
"name": "Deploy",
"actions": [
{
"inputArtifacts": [
{
"name": "BuildArtifact"
}
],
"name": "Deploy",
"actionTypeId": {
"category": "Deploy",
"owner": "AWS",
"version": "1",
"provider": "ElasticBeanstalk"
},
"outputArtifacts": [],
"configuration": {
"ApplicationName": "xxx",
"EnvironmentName": "xxx-stage"
},
"runOrder": 1
}
]
}
],
"artifactStore": {
"type": "S3",
"location": "xxx-artifacts-stage"
},
"name": "xxx-stage",
"version": 15
}
}

最佳答案

要修复更新的 GitHub 源的 webhook,您需要执行以下步骤:

  • 使用 [1] 中的步骤注销和删除与旧 GitHub 存储库关联的现有 Webhook。
  • 使用 [2] 中的步骤重新创建 webhook。

  • 引用:

    [1] 删除 GitHub 源的 Webhook - https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-webhooks-delete.html

    [2] 为 GitHub 源创建 Webhook - https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-webhooks-create.html

    如果您遇到任何挑战,请告诉我。

    关于github - AWS CodePipeline github webhook 未在提交时触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58702453/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com