Skip to main content
Stably provides a dedicated GitHub Action that runs your Playwright tests on Stably Cloud as part of your GitHub workflows. The action automatically detects whether to use v2 (project-based) or v1 (test-suite-based) mode based on the inputs you provide.

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

1

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

Get Project ID

Find your project ID in your Stably dashboard settings or project URL.
3

Create Workflow File

Create the file .github/workflows/stably.yaml in your GitHub repository with your test configuration.

Basic Configuration

Run All Tests

.github/workflows/stably.yaml

Run Specific Playwright Projects

Use the playwright-project-name input to run specific Playwright projects:
.github/workflows/stably.yaml

Select an Environment

Use environment-name to load variables from a Stably Environment. Instead of adding each test secret to GitHub individually, you can upload your .env file to Stably once — the only GitHub secret you need is STABLY_API_KEY, and when credentials rotate you update them in one place instead of in every repo’s settings.
Set up an environment in seconds via Bulk Import — upload a .env file and you’re done.
.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 using env-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 via env-overrides:
.github/workflows/stably.yaml

Action Inputs Reference

Action Outputs

Complete Example

.github/workflows/stably.yaml

Test Organization

For optimal GitHub Actions integration, organize your tests using Playwright projects:
playwright.config.ts
Then reference these projects in your workflows:

Troubleshooting

Make sure you’ve set the required permissions in your workflow:
For organizations, you must first allow these permissions at the organization level.
Verify the project names in your playwright-project-name input match exactly what’s defined in your playwright.config.ts.

Next Steps

Define Test Groups

Organize tests using Playwright projects

Run on Cloud

Learn more about cloud execution

Schedule Tests

Configure automatic test schedules

Configure Notifications

Set up test result notifications