Pipeline Hooks can now run scripts that live outside your infrastructure repository. This lets you declare and version your hook scripts independently, and reference a single, shared collection of hooks from any of your infrastructure repositories.
Declare a source for an after_hook: a go-getter URL that Pipelines will fetch automatically before the hook runs. Preflight checks fetch every declared source, so a broken URL or ref will fail the pull/merge request before any plan or apply runs.
repository {
after_hook "policy_scan" {
name = "Policy Scan"
commands = ["plan"]
source = "git::https://github.com/acme/pipelines-hooks.git?ref=v1.2.0"
execute = ["bash", "$PIPELINES_HOOK_CTX_SOURCE_DIR/scripts/scan.sh"]
}
}Remote script sources are available as of GitHub v4.20.0 and GitLab v2.15.0. See the docs for setup instructions and additional details.