Reputation: 537
I setup a test environment Codebuild + Github and am facing an issue: Every time I make a commit in Github, Codebuild will trigger 3 identical builds.
My buildspec.yml:
version: 0.2
phases:
pre_build:
commands:
# Taskfile
- curl -sL https://taskfile.dev/install.sh | sh
build:
commands:
- ./bin/task build
post_build:
commands:
- zip -r trigger.zip trigger
artifacts:
files:
- 'trigger.zip'
discard-paths: yes
A few notable things:
Do you have any idea why this is happening, and how I can prevent this from happening again?
Upvotes: 2
Views: 1016
Reputation: 537
The problem was with the github hooks: there were three of them.
I'm using Pulumi (terraform) to provision my AWS resources, including CodeBuild, and it looks like destroying the stack in Pulumi doesn't remove the github hook. The two extra hooks were leftovers from previous destroyed stacks.
I will investigate this further, but this is outside of the scope of this question.
Upvotes: 2
Reputation: 736
Thank you for using AWS CodeBuild.
Can you please check the responses of the webhook deliveries in GitHub webhook page? For every webhook delivery that triggered a build, CodeBuild will return a response with message "Webhook received and build started: [the link to the build]". You can check what webhook events triggered the builds, and then apply filters on the events.
Upvotes: 2