Global Hooks
Run shell commands before or after the release pipeline
Hooks let you run arbitrary shell commands at the start or end of the release pipeline.
Minimal config
before:
hooks:
- "echo 'Starting release'"
- "cargo fmt --check"
after:
hooks:
- "echo 'Release complete'"
- "./scripts/notify.sh"Behavior
beforehooks run before any pipeline stage executesafterhooks run after all pipeline stages complete successfully- Each hook is executed via
sh -c "<command>" - If any
beforehook fails (non-zero exit), the pipeline aborts - Hooks are skipped in
--dry-runmode (logged but not executed) - Environment variables from the
envconfig section are available to hooks
Use cases
- Pre-flight checks:
cargo fmt --check,cargo clippy - Post-release notifications: Slack webhooks, deployment triggers
- Artifact post-processing: signing, uploading to additional locations