← Back to docs

CI/CD Integration

Validate ACP manifests on every push, PR, or release with a single API call.

GitHub Actions

Add this workflow to validate your manifest on every push:

name: ACP Manifest Check
on:
  push:
    paths:
      - 'acp-manifest.json'
  pull_request:
    paths:
      - 'acp-manifest.json'

jobs:
  validate:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Validate ACP manifest
        run: |
          RESULT=$(curl -s -X POST \
            https://acp-watchtower.vercel.app/api/analyze \
            -H "Content-Type: application/json" \
            -d "{\"manifest\": $(cat acp-manifest.json | jq -Rs .)}")
          
          SCORE=$(echo $RESULT | jq '.score')
          VERDICT=$(echo $RESULT | jq -r '.verdict')
          echo "## ACP Readiness: $SCORE/100 ($VERDICT)" >> $GITHUB_STEP_SUMMARY
          
          CRITICAL=$(echo $RESULT | jq '[.issues[] | select(.severity=="critical")] | length')
          if [ "$CRITICAL" -gt 0 ]; then
            echo "::error::$CRITICAL critical issues found in ACP manifest"
            exit 1
          fi

Diff on PR

Compare the manifest between base and head to catch risky changes:

- name: Diff ACP manifest
  run: |
    git show origin/main:acp-manifest.json > /tmp/old-manifest.json 2>/dev/null || echo '{}' > /tmp/old-manifest.json
    
    DIFF=$(curl -s -X POST \
      https://acp-watchtower.vercel.app/api/diff \
      -H "Content-Type: application/json" \
      -d "{
        \"oldManifest\": $(cat /tmp/old-manifest.json | jq -Rs .),
        \"newManifest\": $(cat acp-manifest.json | jq -Rs .)
      }")
    
    RISK=$(echo $DIFF | jq -r '.releaseRisk')
    echo "Release risk: $RISK" >> $GITHUB_STEP_SUMMARY
    
    if [ "$RISK" = "high" ]; then
      echo "::warning::High release risk detected in ACP manifest changes"
    fi

GitLab CI

acp-validate:
  stage: test
  script:
    - |
      RESULT=$(curl -s -X POST \
        https://acp-watchtower.vercel.app/api/analyze \
        -H "Content-Type: application/json" \
        -d "{\"manifest\": $(cat acp-manifest.json | jq -Rs .)}")
      SCORE=$(echo $RESULT | jq '.score')
      echo "ACP Readiness Score: $SCORE/100"
      CRITICAL=$(echo $RESULT | jq '[.issues[] | select(.severity=="critical")] | length')
      test "$CRITICAL" -eq 0 || exit 1
  only:
    changes:
      - acp-manifest.json

Generic (curl)

Works with any CI system:

#!/bin/bash
set -e

MANIFEST=$(cat acp-manifest.json)
RESULT=$(curl -sf -X POST \
  https://acp-watchtower.vercel.app/api/analyze \
  -H "Content-Type: application/json" \
  -d "{\"manifest\": $(echo "$MANIFEST" | jq -Rs .)}")

SCORE=$(echo "$RESULT" | jq '.score')
CRITICAL=$(echo "$RESULT" | jq '[.issues[] | select(.severity=="critical")] | length')

echo "Score: $SCORE/100"
echo "Critical issues: $CRITICAL"

[ "$CRITICAL" -eq 0 ] || { echo "FAIL: Critical issues found"; exit 1; }

Pro tip: GitHub Webhook

Instead of CI scripts, you can configure a GitHub webhook pointing at https://acp-watchtower.vercel.app/api/github/webhook to automatically analyze manifests on every push. No CI configuration needed.