I am using a webhook to build my project on push requests. By default, AWS CodeBuild builds on push to every branch, however I would like to limit that to master - to trigger the build ONLY when push to master is made. How do I use the regex patterns to do that?
The AWS documentation is not really specific in terms of how to use the regular expressions there.
AWS CodeBuild runs your builds in preconfigured build environments that contain the operating system, programming language runtime, and build tools (e.g., Apache Maven, Gradle, npm) required to complete the task.
These build phases are listed here as install , pre_build , build , and post_build . You cannot change the spelling of these build phase names, and you cannot create more build phase names. In this example, during the build phase, CodeBuild runs the mvn install command.
Set the HEAD_REF
setting to ^refs/heads/master$
. They don't explicitly specify it for master branch in the docs but they do show the equivalent for 'branch1'
source: https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-pull-request.html#sample-github-pull-request-filter-webhook-events-console
You can set the filter group on the webhook, as explained in the documentation @ https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-pull-request.html#sample-github-pull-request-filter-webhook-events-console
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With