Prerequisites
Before setting up CI integration, ensure you have:- A GitHub repository with Playmatic tests
- Playmatic CLI installed:
npm install -g playmatic
- API access: Ensure you’re authenticated with Playmatic
Setting up GitHub Actions
Playmatic provides an automated setup command that configures your entire GitHub Actions workflow.Automatic Setup
Run the CI setup command in your project root:- Detect your repository: Automatically identifies your GitHub repository
- Create CI API key: Generates a dedicated API key for your repository
- Generate workflow file: Creates
.github/workflows/playmatic.yml
with optimal settings - Guide secret setup: Provides instructions for adding the API key to GitHub Secrets
playmatic.yml
file has two sections that you can configure for the workflow. Workflow triggers for deciding when you want to run the Playmatic tests in the CI, and Workflow settings for test running settings.
playmatic.yml
Workflow Triggers
Running on PR merged
The generated workflow automatically runs tests when code is merged to your main branches. This ensures that your main branch always has passing tests after changes are pushed.playmatic.yml
Running on new PR
Tests can also run automatically on new pull requests to catch issues before merging. This provides immediate feedback to developers and prevents broken code from reaching your main branch.playmatic.yml
playmatic.yml
Ensure you are passing in the dynamic preview URL via
base-url-override
, otherwise Playmatic will not be able to test the changes. Running on schedule
To run tests on a regular schedule (for monitoring production environments), add a cron schedule to your workflow:playmatic.yml
0 0 * * *
- Daily at midnight UTC0 */6 * * *
- Every 6 hours0 9 * * 1-5
- Weekdays at 9 AM UTC0 0 1 * *
- First day of every month
Use crontab.guru to help build and verify your cron expressions.
Workflow Settings
The generatedplaymatic.yml
file includes these key settings:
- environment: Specify which test environment from your
playmatic.config.ts
to target - test-paths: Directory containing your Playmatic tests (default:
playmatic-tests
) - base-url-override: Override the base URL for preview deployments
playmatic.yml
Test Execution Summary
After each CI run, you can view a detailed summary report in the GitHub Actions logs with test results, execution times, and any self-healing that occurred:Notifications
Configure test result notifications through the Playmatic dashboard:- Navigate to Alerts: In your team dashboard, go to the Alerts page
- Configure notification preferences:
- All results: Get notified for every test run
- Only issues: Get notified only when tests fail
- Off: Disable all notifications
Slack Integration
Connect your Slack workspace to receive notifications:- Click Connect to Slack in the Alerts settings
- Authorize the Playmatic app in your workspace
- Use
/invite @Playmatic
in channels where you want notifications

Email Notifications
Add additional email recipients beyond the default user who triggered the run:- Enter email addresses in the Email Alerts section
- Configure when to receive alerts (all results, only issues, or off)
Troubleshooting
Common Issues
API Key not working: Ensure thePLAYMATIC_API_KEY
secret is correctly added to your repository settings.
Tests not running: Check that your workflow file is in .github/workflows/
and committed to your repository.
Environment mismatch: Verify the environment
setting in your workflow matches a test environment defined in your playmatic.config.ts
.
Dependency installation fails: Update the install command in your workflow to match your project’s setup (npm, pnpm, yarn, etc.).