Documentation
Quick Start
GreenCI generates Playwright E2E tests for every pull request, runs them against your app, self-heals failures, and commits passing tests back to the PR.
1. Set Up Your API Key
- Go to API Keys and create a new key
- In your GitHub repo, go to Settings → Secrets and variables → Actions
- Add a new secret named
GREENCI_API_KEYwith your key as the value
2. Add the GitHub Action
Create .github/workflows/greenci.yml in your repo. The tests run against your app, so start it first:
name: GreenCI
on:
pull_request:
types: [opened, synchronize]
permissions:
contents: write
pull-requests: write
jobs:
e2e:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install and start your app
run: |
npm ci
npm run dev &
npx wait-on http://localhost:3000
- name: GreenCI
uses: samarrahTech/greenci-action@v1
with:
api-key: ${{ secrets.GREENCI_API_KEY }}
base-url: http://localhost:3000
test-dir: e2e3. (Optional) Connect a project for dashboard results
- Create a project on the Projects page with your repo name
- Open the project and copy its Project ID from the Setup section
- Add
project-id: <your id>to the action'swith:block to upload Playwright traces
Run summaries (pass/fail, self-heals, suspected app bugs) upload automatically whenever an API key is set.
4. Open a Pull Request
That's it. GreenCI analyzes the diff, generates Playwright tests, runs them against your base-url, heals what it can, flags suspected real bugs, and posts a report on the PR.
Bootstrap: start from zero tests
Have an existing app with no E2E coverage? Describe your critical journeys in plain English and run once — GreenCI reads your live pages for real selectors, generates a spec per journey, runs and heals them, and opens a PR with the passing suite:
- uses: samarrahTech/greenci-action@v1
with:
api-key: ${{ secrets.GREENCI_API_KEY }}
mode: bootstrap
base-url: http://localhost:3000
journeys: |
Sign in with email and password at /login
Add an item to the cart and reach checkout
Search for a product from the homepageTrigger it via workflow_dispatch — no code change needed. Mention URL paths in a journey and their rendered HTML is captured for selector grounding. Logged-in journeys get Playwright storageState scaffolding with TODOs.
Bring Your Own LLM
With a BYO provider, the action calls Anthropic or OpenAI directly from your runner — your code never touches the GreenCI API, and no GreenCI quota is used:
- name: GreenCI (BYO-LLM)
uses: samarrahTech/greenci-action@v1
with:
llm-provider: anthropic # or: openai
# llm-model: claude-opus-4-8 # optional override (openai default: gpt-4o)
base-url: http://localhost:3000
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} # or OPENAI_API_KEY| Provider | Config value | Requires |
|---|---|---|
| GreenCI (hosted) | greenci | api-key |
| Anthropic | anthropic | ANTHROPIC_API_KEY env |
| OpenAI | openai | OPENAI_API_KEY env |
| Bedrock, Azure OpenAI, Ollama | — | Roadmap |
Cypress → Playwright Migration
Convert an existing Cypress suite in one run:
- uses: samarrahTech/greenci-action@v1
with:
api-key: ${{ secrets.GREENCI_API_KEY }}
mode: migrate
cypress-dir: cypress/e2e
test-dir: e2eKey rotation
Rotate credentials with zero downtime: create a new key on the API Keys page, update the GREENCI_API_KEY secret in GitHub, then delete the old key. Deleting a key immediately rejects any CI runs still using it.