Every PR runs against its own fresh database branch cloned from your connected source — no shared staging that drifts, no test runs corrupting each other, no production credentials in CI.
Prerequisites
You need:
- An Ardent account with one ready connector. If you do not have one yet, follow the Quickstart.
- An API token stored as a CI secret named
ARDENT_TOKEN.
- The project and connector names you want CI to use.
Find project and connector names locally:
GitHub Actions workflow
Copy this to .github/workflows/ardent-branch.yml, replacing my-project, my-connector, and npm test for your repo.
Why this shape works
ARDENT_TOKEN authenticates the CLI with no login step or stored session.
ardent project switch and ardent connector switch make the workflow predictable.
ardent branch create --print-url prints only the URL, so there’s no human output to parse.
- The branch name includes both PR number and run ID so re-runs and concurrent jobs do not collide.
- Cleanup runs with
if: always() so failed tests still delete the branch.
Other CI providers
The steps are the same on any CI provider:
Store ARDENT_TOKEN in your CI provider’s secret manager. Do not commit tokens to the repository.
JSON variant
If your CI step wants more than the URL, use JSON output:
Compared to shared staging
- Full data, not schema-only: branches carry your real rows, not empty tables.
- Isolation: each PR gets its own database.
- Fast branch creation: once a connector is ready, branch creation is independent of source database size.
- Clean teardown: branches can be deleted after each run and auto-suspend when idle.
Running destructive test suites rather than PR checks? See Regression testing.