Skip to Content
interleavedocs

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:

TriggerStarts whenSet up with
CommentSomeone with write access comments @interleave testNothing, on by default
AutomaticA PR is opened, pushed to or marked ready for reviewtriggers: in interleave.yml
GitHub ActionYour workflow runs the stepA 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 test

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

Rules:

  • 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 triggers says.

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. triggers comes 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_review on 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 matching paths, 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.

ConclusionWhen
โœ… SuccessEvery counted case passed. Flaky cases (failed, then passed on a retry) count as passes.
โŒ FailureA case failed and the judge called it a regression (or couldn't judge it), or a case errored.
โšช NeutralThe 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.

.github/workflows/interleave.yml
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

InputDefault
api-keyrequiredInterleave API key. Pass it from a secret.
prthe event's PRPR number. Empty on push events, where branch is tested instead.
branchthe workflow's branchPushed branch to test when there's no PR.
repogithub.repositoryowner/name of the Interleave project.
instructionsWhat to focus on, like the text after @interleave test.
waittruefalse returns once the run is queued, with conclusion=pending.
fail-on-neutralfalseAlso fail the job when the run proves nothing either way.
api-urlproductionOnly for staging or self-hosted APIs.
cli-versionlatest@interleaveqa/cli version or range. Pin it for reproducible jobs.

Outputs

Output
run-idInterleave run id.
run-numberThe run's number in the project.
urlThe run's page in the dashboard.
statuscompleted, failed or cancelled (queued with wait: false).
conclusionsuccess, 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

PermissionWhy
Contents: readClone the PR's commit and read interleave.yml.
Pull requests: writeRead PR files and post the results comment.
Issues: writeReply to and react on @interleave test comments.
Checks: writeCreate and update the Interleave QA check.
Metadata: readRequired by GitHub for every App.

To remove a repo, go to GitHub โ†’ Settings โ†’ Applications โ†’ Interleave โ†’ Configure.

On this page

Graph view