Overview
The Stably GitHub Action allows you to:- Run all or specific Playwright projects on Stably Cloud
- Override environment variables per-run
- Receive test results as PR comments
- Block deployments on test failures
Setup Instructions
Create API Key Secret
Get your API key from the settings page on the Web UI.Then, go to your GitHub repository, click on “Settings” > “Secrets and variables” > “Actions”. Create a new Repository Secret named
STABLY_API_KEY and paste your API key into the secret value.Basic Configuration
Run All Tests
.github/workflows/stably.yaml
Run Specific Playwright Projects
Use theplaywright-project-name input to run specific Playwright projects:
.github/workflows/stably.yaml
Select an Environment
Useenvironment-name to load variables from a specific environment configured in Stably:
.github/workflows/stably.yaml
Pull Request Comments
PR comments are enabled by default (github-comment: true). To use them, add the required permissions:
.github/workflows/stably.yaml
Environment Variable Overrides
Override environment variables for a specific run usingenv-overrides:
Using Dynamic URLs from Previous Steps
If your preview URL is generated dynamically (e.g. from Vercel or Netlify), capture it and pass it viaenv-overrides:
.github/workflows/stably.yaml
Action Inputs Reference
| Input | Required | Default | Description |
|---|---|---|---|
api-key | Yes | — | Your Stably API key |
project-id | Yes (v2) | — | Your Stably project ID. Use this OR test-suite-id, not both. |
playwright-project-name | No | — | Playwright project name(s) to run. Maps to the --project CLI flag. |
environment-name | No | — | Environment to use (e.g. “Staging”). Falls back to the project’s default. |
env-overrides | No | — | YAML string or JSON object of environment variable overrides. |
test-suite-id | Yes (v1) | — | Test suite ID to execute (v1 only). Use this OR project-id. |
github-comment | No | true | Post test results as a PR/commit comment. |
github-token | No | ${{ github.token }} | Token for posting comments. |
async | No | false | Launch tests without waiting. Comments won’t work in async mode. |
Action Outputs
| Output | Description |
|---|---|
success | Boolean indicating if the run was successful |
runId | The run ID (v2 only) |
testSuiteRunId | The test suite run ID (v1 only) |
Complete Example
.github/workflows/stably.yaml
Test Organization
For optimal GitHub Actions integration, organize your tests using Playwright projects:playwright.config.ts
Troubleshooting
Permission Denied for PR Comments
Permission Denied for PR Comments
Make sure you’ve set the required permissions in your workflow:For organizations, you must first allow these permissions at the organization level.
Project Not Found
Project Not Found
Verify the project names in your
playwright-project-name input match exactly what’s defined in your playwright.config.ts.