Skip to main content
The trunk-io/dynamic-ci action connects a GitHub Actions workflow to Dynamic CI. It asks Trunk which jobs the current change needs and writes one output per job. Your jobs read those outputs in their if: conditions to decide whether to run.

Usage

The action sets one output per job in the workflow, named by the job key. Outputs are set at runtime, so re-export each one from the filter job’s outputs: under the same key:

Matrix outputs

A matrix job decided by variation can also get one of these outputs (v0.1.8 or later), depending on how its matrix is written. Each is set only when some variations are skipped and others run. When every variation is skipped, <job> is 'false' and the job is skipped whole.

Fail-open behavior

The action is built so a problem never causes a job to be skipped by mistake. It retries requests to Trunk, and when it still cannot get a verdict, the output is empty and the job will run.

Checkout

The action compares the pull request’s base and head commits to find the changed files.actions/checkout with clean: false is enough. When the checkout does not contain both commits, the action falls back to github-token to read the changed files.

Versioning

Pin to the major version tag, trunk-io/dynamic-ci@v1, to receive compatible updates automatically.

GitHub token permissions

Grant the workflow pull-requests: read so github-token can read the pull request’s changed files: