Black Friday sale: an extra 40% off every course until Monday, November 30.New Year sale: an extra 30% off every course until Friday, January 1.Memorial Day sale: an extra 25% off every course until Monday, May 31.SysAdmin Day sale: an extra 25% off every course until Sunday, August 1.Back to School sale: an extra 25% off every course until Sunday, August 22.Labor Day sale: an extra 25% off every course until Monday, September 6.Black Friday sale: an extra 40% off every course until Monday, November 29.New Year sale: an extra 30% off every course until Saturday, January 1.Choose your certification →

Copyright (c) 2026 MindMesh Academy. All rights reserved. This content is proprietary and may not be reproduced or distributed without permission.

2.1.2.2. Running Builds/Tests on Pull Requests & Merges

2.1.2.2. Running Builds/Tests on Pull Requests & Merges

Catching bugs before code merges to the main branch prevents broken builds from blocking the entire team. The pattern: every pull request triggers a build-and-test cycle, and the PR can't be merged until tests pass.

With CodeBuild webhooks (GitHub, GitLab, Bitbucket): Give the CodeBuild project the repository as its source and add a webhook filter group on pull request events (for GitHub, PULL_REQUEST_CREATED, PULL_REQUEST_UPDATED, PULL_REQUEST_REOPENED). CodeBuild builds the pull request and, because the build was triggered by a webhook, always reports its status back to the source provider, where it shows on the pull request.

With CodePipeline: a V2 pipeline with a CodeConnections source action can use a pull request trigger (Open, Update, or Closed events, filtered by branch and file path) to run the whole pipeline for a pull request. Alternatively, use GitHub Actions or Bitbucket Pipelines to call CodeBuild directly via the aws codebuild start-build API.

Build Badge pattern: CodeBuild generates a badge URL that shows pass/fail status. Embed this in your repository README to give the team instant visibility into build health. Enable it in the CodeBuild project settings.

Merge gating: merge rules live in the Git provider. GitHub or Bitbucket branch protection rules (GitLab protected branches) can block a merge until the latest commit's status checks pass, and the build status CodeBuild reports for the pull request is that check; a protected branch can also require approvals. A common pattern requires:

  1. At least one peer approval
  2. All CI tests passing
  3. No merge conflicts with the target branch

Separation of duties for IaC pipelines: the PR approval gives four-eyes review of the code, a manual approval action before the deploy stage gates the release, distinct IAM roles for build and deploy keep the author from shipping alone, and CloudTrail records every approval and deploy call.

Exam Trap: CodePipeline V1 doesn't support triggers, so it can't start on pull request events; it starts on new commits to the configured branch. If the exam asks about running tests on pull requests, the answer is a CodeBuild webhook on pull request events, or a V2 pipeline with a pull request trigger. CodePipeline manual approval actions gate pipeline stages, not pull request merges.

💡 Tip: Run a lighter test suite on PR builds (unit + lint) and the full suite on merge to main. This keeps PR feedback under 5 minutes while maintaining thorough validation on the main branch.

See how it connects
Alvin Varughese
Written byAlvin Varughese
Founder•26 professional certifications earned