A GitHub-backed CodeBuild project must test pull requests when they are created or updated, but only when they target main. How should the webhook filters be configured?
Show the answer
Correct answerD. One filter group combining the pull request events with a BASE_REF filter matching main
AWhy not this: Separate groups use OR logic, so the destination restriction would not constrain the pull request event group.
BWhy not this: A push filter detects branch pushes rather than pull request creation and updates targeting that branch.
CWhy not this: HEAD_REF filters the pull request's source branch rather than its destination branch.
DWhy this is right: The event filter selects pull request creation or updates, and BASE_REF restricts their destination to main.
Filters within a CodeBuild webhook filter group are combined with AND, and BASE_REF identifies the pull request's destination branch. HEAD_REF identifies its source branch, so filtering it for main would test the wrong condition.