Actions

You can think of Trunk Actions as IFTTT for your repository. An action is a command that is run when a specified trigger occurs.

The most common Trunk Actions are provided out of the box with trunk, and are triggered to invisibly autoformat (trunk fmt) your commits every time you git commit, and run trunk check when you git push.

Triggers

There are several different types of Trunk Actions, based on when they are triggered:

Command Line

Discovering Actions

The trunk plugins repo ships with a collection of actions that can help supercharge your repository and provide examples of how to write your own actions. To see a list of actions that you can enable in your repo run:

trunk actions list

Enable/Disable Actions

Trunk only runs actions listed in the enabled section of your trunk.yaml. Some built-in actions are enabled by default and can be disabled explicitly by adding them to the disabled list. You can always run trunk actions list to check the enabled status of an action.

actions:
  enabled:
    - trunk-announce
    - git-lfs
    - trunk-check-pre-push
    - trunk-fmt-pre-commit
    - trunk-cache-prune
    - trunk-upgrade-available

Last updated