CI/CD Integration
Run Testy Claw agent tasks as part of your CI/CD pipeline. The CLI exits with standard exit codes so any pipeline can gate on success or failure.
Installing in CI
Install Testy Claw as a dev dependency so the version is pinned and cached with your other packages.
terminal
npm install --save-dev testy-clawEnvironment variables in CI
Set your API key as a CI secret. Never hardcode it in your workflow files.
- GitHub Actions: Settings → Secrets → OPENAI_API_KEY
- GitLab CI: Settings → CI/CD → Variables → OPENAI_API_KEY
- Buildkite: Pipeline Settings → Environment → OPENAI_API_KEY
GitHub Actions
.github/workflows/agent.yml
name: Testy Claw Agent
on:
push:
branches: [main]
jobs:
agent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run agent task
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: npx testy-claw run "update the CHANGELOG.md with commits since last tag"GitLab CI
.gitlab-ci.yml
agent-task:
image: node:20
script:
- npm ci
- npx testy-claw run "generate API docs from source"
variables:
OPENAI_API_KEY: $OPENAI_API_KEYTipUse
--max-steps to cap agent runs in CI. A lower limit (e.g. 10) prevents runaway tasks from consuming API credits.Gating on exit codes
Testy Claw exits 0 on success and non-zero on failure. Most CI systems automatically fail the job on a non-zero exit, so no extra configuration is needed.