Kiwi

Kiwi for AWS CodeBuild

Report check results from AWS CodeBuild to a run's Verify step with a checker key.

  • Posts named check results over HTTP with a checker key. The key can report only the checks you choose in one project.
  • Checks reserved for CI accept results only from a checker key.
  • Records each result against the candidate under review. A pass counts toward Verify; a fail means the run needs rework.
  • Records a retried report once.
  • Kiwi does not start pipelines or read their logs. It records the results your pipeline sends.

Set up

Store your checker key in AWS Secrets Manager as a plaintext secret named kiwi-checker-key that the project's service role can read, and add report-kiwi-check.sh from the setup guide to your repository.

This buildspec.yml runs your tests, then reports the tests-pass check as pass or fail:

version: 0.2

env:
  secrets-manager:
    KIWI_CHECKER_KEY: kiwi-checker-key

phases:
  install:
    runtime-versions:
      nodejs: 22
    commands:
      - apt-get update && apt-get install -y uuid-runtime
  build:
    commands:
      - npm ci && npm test
  post_build:
    commands:
      - if [ "$CODEBUILD_BUILD_SUCCEEDING" = 1 ]; then status=pass; else status=fail; fi
      - ./report-kiwi-check.sh tests-pass "$status" "$CODEBUILD_BUILD_URL"

Start the build with overrides and add the Kiwi run ID as the KIWI_RUN_ID environment variable. Use an Ubuntu standard image, standard:7.0 or later.

The post_build phase runs even when the tests fail.

Replace tests-pass with the check ID from your plan.