Skip to content

Configuration

Config is discovered from (in order):

  1. Custom path via --config
  2. workflow.json or workflow.jsonc in git root
  3. .config/workflow.json or .config/workflow.jsonc
  4. workflows field in package.json
package.json
{
"workflows": {
"build": {
"steps": [
{ "name": "install", "displayName": "Install dependencies", "cmd": "bun install --frozen-lockfile" },
{ "name": "build", "bun": { "script": "build" }, "dependsOn": ["install"] }
]
},
"sync-config": {
"steps": [
{
"name": "copy-from-main",
"branches": ["worktree:*", "!main"],
"worktree:cp": {
"from": "worktree:main",
"files": [".config/settings.json",".env"],
"allowMissing": true
}
}
]
},
"test-all": {
"steps": [
{
"name": "test",
"bun": {
"script": "test",
"dependsOn": ["^build"],
"timeout": 60000
}
}
]
}
}
}

Configure worktree defaults and hooks in the worktree section of your config:

{
"worktree": {
"defaults": {
"base_dir": "../worktrees" // Relative to git root
},
"hooks": {
"post_create": [
{
"type": "copy",
"from": ".env",
"to": ".env"
},
{
"type": "command",
"command": "bun install"
}
]
}
}
}