1
Configure Secrets in BuildKite: Create a Trunk API key and add it to BuildKite's secret store named TRUNK_API_TOKEN
The key doesn’t need any permissions.
2
Configure BuildKite to export CI data to Trunk: connecting BuildKite's OTEL data allows us to learn the behavior of your CI jobs
3
Paste a BuildKite API token with the read_builds and read_organizations scopes into Settings → Organization → Buildkite. Use a token from a dedicated BuildKite user.
Give your steps keys
Add akey: to every step you might want skipped. A step without one always
runs.
Start with a dry run
Add this step to each pull request pipeline that runs your tests and checks. Trunk records verdicts, and your pipeline is unchanged.if: and agents: as your other pull request steps.
Add the plugin to your upload step
When you are ready to skip steps, pipe your pipeline through the filter on its way to upload:- Pin an exact release, v0.1.3 or later.
- Don’t pass
--no-interpolationtobuildkite-agent pipeline upload. trigger:steps are never skipped. Matrix andparallelism:legs skip together.
Mark steps that must never be skipped
Trunk can’t tell which Buildkite steps are required to merge. Before you turn on enforcement, list them inexclude-keys:
Pipelines with no upload step (step mode)
Pipelines with no upload step (step mode)
If your pipeline lives in Buildkite’s settings editor, put the plugin on the
step itself with
mode: step. The step needs a key:. It saves less,
because the agent has already started, and a skipped step reports as passed.Send your build tool's impact (v0.1.8 or later)
Send your build tool's impact (v0.1.8 or later)
If your build tool measures how much of the codebase a change affects,
such as a count of affected packages, send it so Trunk runs broad changes.
Export it as a JSON list in the upload step’s command, before the filter
runs:
source: your name for the measure (lowercase letters, digits,.,_,-). Keep it the same on every build.count: a whole number. Send0when nothing is affected.all: truein place ofcountwhen everything is affected.
All options
All options
Troubleshooting
Setdebug: true to print what the plugin asked for and the plan it got back.
- Nothing is skipped. Check the repository is Enforced, the steps have a
key:, and Trunk has a couple of days of builds for them. - The plan request returns 404. The pipeline’s remote doesn’t match a repository in your Trunk organization with CI data.
baseShais null on a pull request build. Fetch the target branch before the upload step.