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:
- Manual builds only trigger one build
- The three builds are from the same hook and source version
- In github, the commit is only referencing the first of the 3 builds (latest commit points to build 13, previous commit points to build 9, etc).
- My project only has one branch (master)
Do you have any idea why this is happening, and how I can prevent this from happening again?
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.