Using with GitHub Actions
Automate agent tasks on every push, PR, or schedule using GitHub Actions. Testy Claw works as a standard CLI step — no custom action required.
Basic workflow
.github/workflows/claw.yml
name: Testy Claw
on:
push:
branches: [main]
pull_request:
jobs:
run-agent:
runs-on: ubuntu-latest
permissions:
contents: write # needed if the agent commits files
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # full history for git tool
- uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
- run: npm ci
- name: Run Testy Claw
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: |
npx testy-claw run "update CHANGELOG.md with commits since last tag" \
--max-steps 10 \
--verboseCommitting agent output back
If the agent writes files you want to commit back to the repo, add a commit step after the agent run.
.github/workflows/claw.yml
- name: Commit agent changes
run: |
git config user.name "testy-claw[bot]"
git config user.email "bot@testyclaw.dev"
git add -A
git diff --staged --quiet || git commit -m "chore: agent update [skip ci]"
git pushScheduled runs
.github/workflows/claw-nightly.yml
on:
schedule:
- cron: "0 2 * * *" # 2am UTC every night
jobs:
nightly-agent:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with: { node-version: 20, cache: npm }
- run: npm ci
- env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
run: npx testy-claw run "audit dependencies and open a PR if outdated"TipAdd
[skip ci] to agent commit messages to prevent infinite workflow loops when the agent pushes changes.