Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 1.5 KB

File metadata and controls

47 lines (35 loc) · 1.5 KB
title Lifecycle hooks
summary Run setup commands at specific points in a Roark workflow.
dateCreated 2026-05-08 06:27:02 UTC
lastUpdated 2026-07-25 07:13:47 UTC
{
  "hooks": {
    "beforeRun": "bun install --frozen-lockfile",
    "beforeVerify": "bun install --frozen-lockfile",
    "timeoutMs": 600000
  }
}

Hooks

  • afterCreate: runs after a new workspace is cloned and checked out.
  • beforeRun: runs before agent workflow execution.
  • beforeVerify: runs immediately before verification.
  • afterRun: runs after workflow completion; failures warn instead of stopping the run.
  • beforeRemove: runs before workspace removal; failures warn instead of stopping removal.

Put dependency installation in beforeRun and beforeVerify. A new workspace runs beforeRun immediately after creation; adding the same command to afterCreate runs it twice. Reserve afterCreate for one-time setup.

review-pr and revise-pr use the same hooks and verification setup. Both run them against the PR checkout.

Timeout

timeoutMs controls hook timeout. The default is 600000 milliseconds.

Use hooks for

  • Install dependencies.
  • Generate local build artifacts required by verification.
  • Run lightweight setup checks.

Do not use hooks for

  • Writing secrets into Git-tracked files.
  • Long-running daemons.
  • Interactive prompts.
  • Commands that mutate unrelated host state.

For ignored local file copying, prefer workspace.copyToWorktree. See Managed workspaces.