> For the complete documentation index, see [llms.txt](https://perceptdot.gitbook.io/perceptdot/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://perceptdot.gitbook.io/perceptdot/github-action.md).

# GitHub Action

Automatically run visual QA on every deployment — no AI tool required.

***

## What it does

Every time you deploy, perceptdot takes a screenshot of your live URL and checks for visual bugs. Results appear directly in your workflow summary.

***

## Setup (3 steps)

### Step 1 — Get your API key

Enter your email at [perceptdot.com](https://perceptdot.com) — key sent instantly.

### Step 2 — Add the secret

In your GitHub repo: **Settings → Secrets and variables → Actions → New repository secret**

* Name: `PERCEPT_API_KEY`
* Value: your API key

### Step 3 — Add the action to your workflow

```yaml
name: Deploy and Visual QA

on:
  push:
    branches: [main]

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

      # Your existing deploy step
      - name: Deploy
        id: deploy
        run: echo "url=https://your-site.com" >> $GITHUB_OUTPUT

      # perceptdot visual check
      - name: Visual QA
        uses: perceptdot/eye-action@v1
        with:
          url: ${{ steps.deploy.outputs.url }}
          api_key: ${{ secrets.PERCEPT_API_KEY }}
          fail_on_issue: 'false'
```

***

## Inputs

| Input           | Required | Default | Description                                                |
| --------------- | -------- | ------- | ---------------------------------------------------------- |
| `url`           | ✅        | —       | URL to check (e.g. Vercel preview URL)                     |
| `api_key`       | ✅        | —       | Your perceptdot API key                                    |
| `fail_on_issue` | ❌        | `false` | Set `true` to fail the workflow if visual issues are found |

***

## Outputs

| Output       | Description                           |
| ------------ | ------------------------------------- |
| `result`     | Full AI analysis result (JSON)        |
| `has_issues` | `true` if visual issues were detected |
| `summary`    | Human-readable summary of findings    |

***

## Example: Block deploy on visual bug

Set `fail_on_issue: 'true'` to automatically block merges when layout bugs are found:

```yaml
- name: Visual QA (blocking)
  uses: perceptdot/eye-action@v1
  with:
    url: ${{ steps.deploy.outputs.url }}
    api_key: ${{ secrets.PERCEPT_API_KEY }}
    fail_on_issue: 'true'
```

***

## Example: Use with Vercel preview deployments

```yaml
- name: Deploy to Vercel
  id: vercel
  uses: amondnet/vercel-action@v25
  with:
    vercel-token: ${{ secrets.VERCEL_TOKEN }}
    vercel-org-id: ${{ secrets.VERCEL_ORG_ID }}
    vercel-project-id: ${{ secrets.VERCEL_PROJECT_ID }}

- name: Visual QA on preview
  uses: perceptdot/eye-action@v1
  with:
    url: ${{ steps.vercel.outputs.preview-url }}
    api_key: ${{ secrets.PERCEPT_API_KEY }}
```

***

## Viewing results

After the workflow runs, click the **perceptdot Visual Check** step to see:

* ✅ No issues, or a list of detected bugs with severity levels
* Number of tiles analyzed and scan time
* Credits used

***

{% hint style="info" %}
**Tip:** Use `fail_on_issue: 'false'` (default) during initial setup to observe results without blocking your pipeline. Switch to `'true'` once you're confident in the signal.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://perceptdot.gitbook.io/perceptdot/github-action.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
