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

  1. Go to API Keys and create a new key
  2. In your GitHub repo, go to Settings → Secrets and variables → Actions
  3. Add a new secret named GREENCI_API_KEY with 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: e2e

3. (Optional) Connect a project for dashboard results

  1. Create a project on the Projects page with your repo name
  2. Open the project and copy its Project ID from the Setup section
  3. Add project-id: <your id> to the action's with: 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 homepage

Trigger 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
ProviderConfig valueRequires
GreenCI (hosted)greenciapi-key
AnthropicanthropicANTHROPIC_API_KEY env
OpenAIopenaiOPENAI_API_KEY env
Bedrock, Azure OpenAI, OllamaRoadmap

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: e2e

Key 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.