From dc911f8860c67923d8fffb0b20d9a56ad8d2f8a5 Mon Sep 17 00:00:00 2001 From: Karl Skidmore <1645788+karlskidmore@users.noreply.github.com> Date: Fri, 15 Mar 2019 19:39:23 +0300 Subject: [PATCH] Add PollForSourceChanges attribute Explicit turn-off of PollForSourceChanges when github token present, to prevent pipeline being triggered twice (i.e. via webhook and periodic polling). See here for background: https://docs.aws.amazon.com/codepipeline/latest/userguide/pipelines-webhooks-create.html --- templates/assets/cloudformation/pipeline.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/templates/assets/cloudformation/pipeline.yml b/templates/assets/cloudformation/pipeline.yml index 0d1b3c56..4aa46141 100644 --- a/templates/assets/cloudformation/pipeline.yml +++ b/templates/assets/cloudformation/pipeline.yml @@ -428,6 +428,11 @@ Resources: - HasGitHubToken - !Ref GitHubToken - !Ref AWS::NoValue + PollForSourceChanges: + Fn::If: + - HasGitHubToken + - "false" + - "true" - RepositoryName: !Ref SourceRepo BranchName: !Ref SourceBranch RunOrder: 10