ManualContinuous integration
Use existing CI jobs
Use the result of a GitHub Actions job you already run on pull requests to decide when a change can land.
If GitHub already runs your tests on pull requests, you can use that workflow. A train check lets Berrit wait for your job on the combined commit that’s about to land. This is why you may see another pull request for the same change. How GitHub pull requests fit in
Test the pull request head
Section titled “Test the pull request head”Connect your repository through the GitHub App. When the train needs a result from your job, Berrit pushes the candidate to berrit/train/… and opens a test pull request against the target branch. GitHub starts your normal pull request workflow.
Let your job run on that pull request and check out its head SHA explicitly. This is the commit the train needs to test. Here’s what that looks like in .github/workflows/ci.yml for a Node.js repository.
name: Pull request CIon: pull_request:
permissions: contents: read
jobs: test: name: Unit tests runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 with: ref: ${{ github.event.pull_request.head.sha }} persist-credentials: false - uses: actions/setup-node@v6 with: node-version: 24 - run: npm ci - run: npm testYou can keep the job name, dependencies and test commands your project already uses.
Match the job in Berrit
Section titled “Match the job in Berrit”Add a check to checks.toml at the root of the target branch. Here on tells Berrit when to look for a job result. GitHub still decides when to run your workflow.
- Use
pushfor feedback on each submitted revision, orapprovedfor a result on that revision once its review requirements pass. A pull request workflow needs the change’s imported or mirrored pull request for these stages. If you send a change directly with mirroring off, there’s no review pull request to trigger the job. - Use
trainto require a result on the combined candidate. For this stage Berrit opens a test pull request even if you’ve turned off ordinary pull request mirroring.
You can select more than one stage. With on = ["push", "train"], for example, the job needs to run on both kinds of pull request. Copy its name exactly as GitHub displays it. For our example that’s Unit tests. For a matrix, give each required job its own check and include its suffix in the name.
[[check]]name = "Unit tests"app = "github@apps.berrit"on = ["train"]paths = ["**"]required = truetimeout = "30m"With app set and no workflow, Berrit waits for GitHub to report the job. If you’re switching an existing check to this setup, remove its workflow field and change the name in that same block. If you need to delay the job itself until approval, have Berrit dispatch the workflow at approved. A GitHub pull_request event can start an observed job as soon as the pull request opens.
What if this job is expensive and you only want it to run on the train? Keep on = ["train"] as above. In GitHub, a pull_request.branches filter looks at the branch the PR targets, which might be main for both a review PR and a train PR. To pick just the train, check the head branch on the job with if: startsWith(github.head_ref, 'berrit/train/'). If you later add push or approved, adjust that filter too, or Berrit will wait for a result the skipped job can’t provide.
Verify the result
Section titled “Verify the result”Send an approved change through the train. On the change, open Checks and follow Details beside Unit tests. It should take you to the GitHub job that tested the candidate. The App reads the result from GitHub, so you don’t need to give the workflow any Berrit credentials.