如何在AWS codepipeline中配置git推送触发器?

问题描述 投票:0回答:1

“由于没有正确的方法使用 cdk 为 aws codepipeline 配置推送过滤器,所以我尝试了以下方法。但是它给了我一个错误,如下所示。尝试了多种方法,但没有一个起作用。任何人都有线索这个?

代码:

const cfnPipeline = pipeline.node.defaultChild as codepipeline.CfnPipeline;
cfnPipeline.addPropertyOverride("Triggers.0.GitConfiguration.Push.0.Branches", {
  Includes: ["main", "dev"],
});

错误:

Properties validation failed for resource PipelineABCD5664GGD with message: [#/Triggers/0/GitConfiguration/Push: expected type: JSONArray, found: JSONObject]
amazon-web-services aws-cdk aws-codepipeline
1个回答
0
投票

似乎缺少

Triggers.0.Gitconfiguration.Push
数组 - 设置整个数组而不是仅第一个元素:

const cfnPipeline = pipeline.node.defaultChild as codepipeline.CfnPipeline;
cfnPipeline.addPropertyOverride("Triggers.0.GitConfiguration.Push", [
  { Branch: { Includes: ["main", "dev"] } },
]);
© www.soinside.com 2019 - 2024. All rights reserved.