Cannot get build to trigger on PR or master

0

I'd really like my build to automatically fire anytime someone posts a PR or pushes to master. For whatever reason it never works. I'm using GitHub webhooks and have a Primary source webhook event configured for PUSH and HEAD_REF = (master|pr.*) which seems like the correct RegEx, but it doesn't work. If I do master it works for master, if I do pr it works for PR's... what am I missing.

Thanks in advance.

asked 4 years ago914 views
4 Answers
0
Accepted Answer

Hi StealthSid2,

For your use case, you can use two filter groups:

First filter group:
Event type: PUSH
HEAD_REF: master

Second filter group:
Event type: PULL_REQUEST_CREATED
BASE_REF: master

Best,
Zhen

AWS
Zhen Li
answered 4 years ago
0

Hi StealthSid2, for webhook event filtering, please use the EVENT filter (like the setting in Zhen's response). HEAD_REF and BASE_REF are used to filter the branches of a PR or Push event.

For more details, please check the sample in our documentation https://docs.aws.amazon.com/codebuild/latest/userguide/sample-github-pull-request.html#sample-github-pull-request-filter-webhook-events

Thank you for using AWS CodeBuild.

AWS
answered 4 years ago
0

Sorry for the late reply... I don't get notifications from the forum. Let me try this and then mark the appropriate answer.

answered 4 years ago
0

I cannot believe I didn't notice the abilty to add multiple filter groups. I was trying to shoehorn it into a single regex on one filter group. Thanks so much for the help!

answered 4 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions