GitHub
PR comment triggers, automatic PR runs, the Interleave QA check and the GitHub Action.
Interleave works through its GitHub App. It reads code, writes PR comments and checks, and never pushes. There are three ways to start a run from GitHub:
| Trigger | Starts when | Set up with |
|---|---|---|
| Comment | Someone with write access comments @interleave test | Nothing, on by default |
| Automatic | A PR is opened, pushed to or marked ready for review | triggers: in interleave.yml |
| GitHub Action | Your workflow runs the step | A workflow file and an API key |
Every run started from GitHub gets a PR comment and an Interleave QA check.
Comment trigger
On any open PR, comment:
@interleave testYou get ๐ on your comment and a reply, ๐ Interleave QA ยท Run #N queued, with a Watch live โ link. The reply is edited in place with the results.
Add focus instructions after the command, on the same line or the lines below:
@interleave test sign in and open /orders page 2Rules:
- The command has to start a line. Mentions mid-sentence, in quotes (
>) or in code blocks don't count. - Editing an old comment to add the command does start a run.
- Only collaborators with write, maintain or admin access to the repo can start runs. Others get a reply saying so.
- Comments always work, whatever
triggerssays.
Automatic runs
Off by default. Turn them on in interleave.yml on your default branch:
triggers:
pull_request:
enabled: true
branches: [main]
paths: ["src/**", "!**/*.md"]
instructions: Focus on the flows this PR changes.The reference lists every field. How automatic runs behave:
- Read from the base branch.
triggerscomes from the tip of the PR's base branch, never from the PR's head, so a PR can't switch automatic runs on for itself. - New push, new run. A push while a run is in progress cancels that run. Its check completes as neutral, and the new run takes over the same PR comment.
- Once per commit. Reopening a PR, or a
ready_for_reviewon a commit that already ran, starts nothing new. - Drafts wait. With
skip_drafts: true(the default), a draft PR runs once it's marked ready. - Filters. A PR into a branch outside
branches, or that changes no file matchingpaths, is skipped. - Forks never auto-run. The PR gets a neutral check, "Skipped: pull request from a fork".
- Closing cancels. Closing a PR cancels its in-progress run.
Automatic runs count toward your plan's run limit like any other run. Narrow them with branches and
paths if that matters.
The Interleave QA check
Every run started from GitHub creates an Interleave QA check on the PR's head commit. It goes from queued to in progress and completes with one of three conclusions. The PR comment's icon follows the same rule, so the two never disagree.
| Conclusion | When |
|---|---|
| โ Success | Every counted case passed. Flaky cases (failed, then passed on a retry) count as passes. |
| โ Failure | A case failed and the judge called it a regression (or couldn't judge it), or a case errored. |
| โช Neutral | The run proves nothing either way: cases need a look or were blocked, risks went untested, the run stopped early (budget or time limit), couldn't finish, or was cancelled. |
The check's summary has the counts, one line per case and links to the report. Quarantined cases are listed last as "quarantined, not counted" (why).
Re-run on a completed check starts a new run of the same commit. It needs write access, like a comment.
Requiring the check
To block merges on Interleave, add Interleave QA as a required status check in your branch protection rules or ruleset. A neutral conclusion doesn't block a merge in GitHub, so only regressions and errors do.
GitHub Action
You don't need the Action to get PR checks: the App already posts them. Use the Action when a run should be a step in your own workflow: after a preview deploy, on a schedule, behind other jobs, or to gate a job on the result.
Pick one
With triggers.pull_request on, running the Action on pull_request too would start two runs per push.
Use one or the other.
Set the repo up with interleave init and install the GitHub App.
Create an API key in the dashboard (API keys โ Create key, named e.g.
"GitHub Action") and add it as the repository secret INTERLEAVE_API_KEY. It acts as you, so treat it
like a password.
Add a workflow. No actions/checkout is needed: the run happens in Interleave's sandbox, on the commit
GitHub has.
name: Interleave QA
on:
pull_request:
types: [opened, synchronize, ready_for_review]
concurrency:
group: interleave-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
qa:
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: kevin-lann/interleave/action@main
with:
api-key: ${{ secrets.INTERLEAVE_API_KEY }}
instructions: Focus on the flows this PR changes.The Action isn't on the Marketplace yet. Pin a commit SHA instead of @main for reproducible jobs.
Inputs
| Input | Default | |
|---|---|---|
api-key | required | Interleave API key. Pass it from a secret. |
pr | the event's PR | PR number. Empty on push events, where branch is tested instead. |
branch | the workflow's branch | Pushed branch to test when there's no PR. |
repo | github.repository | owner/name of the Interleave project. |
instructions | What to focus on, like the text after @interleave test. | |
wait | true | false returns once the run is queued, with conclusion=pending. |
fail-on-neutral | false | Also fail the job when the run proves nothing either way. |
api-url | production | Only for staging or self-hosted APIs. |
cli-version | latest | @interleaveqa/cli version or range. Pin it for reproducible jobs. |
Outputs
| Output | |
|---|---|
run-id | Interleave run id. |
run-number | The run's number in the project. |
url | The run's page in the dashboard. |
status | completed, failed or cancelled (queued with wait: false). |
conclusion | success, failure or neutral (pending with wait: false). Same rule as the check. |
The job passes on success, fails on failure, and passes with a warning on neutral unless
fail-on-neutral: true. The job summary lists the run's narrative and every case.
Runs started by the Action show as GitHub Action in the dashboard and count toward the same plan limits as any other run.
Fork pull requests
PRs from forks run untrusted code, so by default Interleave refuses them: a @interleave test
comment gets a reply explaining why, and automatic runs skip them with a neutral check.
To test a fork's change, push its branch to the repo itself and comment again. A project can instead be set to run fork PRs without project secrets (as GitHub Actions does), or with them. There's no dashboard setting for this yet; contact support to change it.
Don't work around this with pull_request_target in a workflow: that would run untrusted code with
your API key.
Permissions the App asks for
| Permission | Why |
|---|---|
| Contents: read | Clone the PR's commit and read interleave.yml. |
| Pull requests: write | Read PR files and post the results comment. |
| Issues: write | Reply to and react on @interleave test comments. |
| Checks: write | Create and update the Interleave QA check. |
| Metadata: read | Required by GitHub for every App. |
To remove a repo, go to GitHub โ Settings โ Applications โ Interleave โ Configure.