GitHub + Vercel
Test every pull request's preview and get the results as a comment on the PR. Setup takes about 15 minutes.
1. Add the workflow
Save this as .github/workflows/tensteps.yml:
name: Tensteps
on:
# A preview finished deploying.
deployment_status:
# A PR was opened after its branch's preview was already built.
pull_request:
types: [opened, reopened, ready_for_review]
permissions:
contents: read
pull-requests: write
deployments: read
jobs:
tensteps:
if: github.event_name == 'pull_request' || github.event.deployment_status.state == 'success'
runs-on: ubuntu-latest
timeout-minutes: 30
concurrency:
group: tensteps-${{ github.event.deployment.sha || github.event.pull_request.head.sha }}
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.deployment.sha || github.event.pull_request.head.sha }}
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Run Tensteps
continue-on-error: true
run: npx --yes tensteps@beta run --max-cost 10
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
VERCEL_AUTOMATION_BYPASS_SECRET: ${{ secrets.VERCEL_AUTOMATION_BYPASS_SECRET }}
GITHUB_TOKEN: ${{ github.token }}
- name: Upload the report
if: always()
uses: actions/upload-artifact@v4
with:
name: tensteps-report
path: .tensteps/runs/
if-no-files-found: ignore
retention-days: 30
2. Add your tensteps.yml
Commit a tensteps.yml at the repo root (see the Quickstart). Set how many personas a pull request gets:
triggers:
pull_request: { sessions: 6 }
Without a triggers block, a pull request gets 30 personas per study, which costs more than you probably want while trying it out.
3. Add the secrets
In the repo's Settings → Secrets and variables → Actions, add:
| Secret | Where to get it |
| --- | --- |
| ANTHROPIC_API_KEY | Claude Console → API keys. Use a key with a spend limit. |
| VERCEL_AUTOMATION_BYPASS_SECRET | Only if your previews use Deployment Protection: Vercel project → Settings → Deployment Protection → Protection Bypass for Automation. |
Secrets your studies log in with (secret:TEST_PASSWORD in auth) are read from environment variables of the same name; add them as secrets and to the step's env.
What happens on a pull request
- When Vercel finishes a preview, Tensteps posts "Testing … with 6 personas" on the PR, then replaces it with the results.
- Every push updates the same comment. Each commit is tested once; Re-run jobs in GitHub Actions tests it again.
- Opening a PR for a branch whose preview is already live tests that preview right away.
- The full report is attached to the workflow run as
tensteps-report. Download it and openreport.html. - During the pilot, Tensteps never fails your checks. If a run can't finish (a missing key, no credit), the comment says why.
What gets skipped
Tensteps skips, and says why on the run's summary page:
- production deploys and deploys that didn't succeed
- commits that are no longer the PR's latest
- draft pull requests, until they're marked ready
- pull requests filtered out by
triggers.pull_request(branches,head_branches,labels,paths)