Stop CodePipeline from triggering on every GitHub commit/push

0

When I was first tried out CodePipeline to integrate with GitHub repository, it created a connection with a GitHub app, and the pipeline executes whenever new commits are pushed. That was fine for learning the basics, but now we want to implement a regular build schedule instead (e.g. build every midnight). It seemed rather straight forward enough to define a CloudWatch Events rule with that schedule.

But, I can't find any means to stop the pipeline from reacting to each and every push? The CodePipeline setup console uses GitHub v2 provider, and it shows nothing about trigger conditions.

It appears the webhook method is only applicable to GitHub v1 provider? Don't see anything controllable from GitHub side either.

https://docs.aws.amazon.com/codepipeline/latest/userguide/appendix-github-oauth.html#update-change-detection-console-github

How does the GitHub v2 provider interact with GitHub repository under the hood? And how to control it?

icelava
질문됨 4년 전2503회 조회
5개 답변
1
수락된 답변

Earlier this year (2021), a new option was added to CodeStar Connection-based source actions for CodePipeline - this option now allows you to prevent triggering of the CodePipeline on git commits.

In the console, the option can be found when creating or editing a Source Actions that is attached to a Bitbucket, GitHub (Version 2), or GitHub Enterprise Server source provider. Under the section named “Change detection options” the option is exposed as a “Start the pipeline on source code change” checkbox.

In the SDK/CLI, this option is known as “DetectChanges”. More information can be found @ https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html#action-reference-CodestarConnectionSource-config

AWS
답변함 3년 전
0

Looking at the nature of the underlying (CodeStar?) connection that CodePipeline relies on,

https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html

Note
For a CodeStarSourceConnection source action, you do not have to set up a webhook or default to polling. The connections action manages your source change detection for you.

Well, what happens if we don't want the action to do its own thing? - to make it scheduled execution instead?

icelava
답변함 4년 전
0

Testing out another pipeline with BitBucket (because eventually our actual team projects are hosted there), and looks like BitBucket source action has the same deficiency. Not good.

Edited by: icelava on Oct 31, 2020 4:45 AM

icelava
답변함 4년 전
0

Multiple AWS staff have informed me via other channels that indeed the current GitHub/BitBucket integration feature set lacks this functionality. The exposure of the underlying event rule (for control) will be implemented in future versions.

icelava
답변함 3년 전
0

GithubActions have a really nice fine grain control when events are fired. Maybe a combination of that and an S3 SourseAction might solve your issue.

답변함 3년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠