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

Triggers

trigger

description

time based

run on a schedule (once an hour, once per day, once per week)

file modification

run whenever a file or directory in your repo changes.

githooks

run whenever a listed githook event fires (e.g. pre-commit, on-push)

manual

run from the command line trunk run <action-name>

Command Line

trunk actions <command>

description

list

list all available actions in the repository

history <action-name>

print the history for execution of the provided action

enable <action-name>

enable the provided action

disable <action-name>

disable the provided action

run <action-name>

manually trigger the provided action

Discovering Actions

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

trunk actions list
863863

List of actions reported by 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

Did this page help you?