Create a new `Push` type policy in Spacelift; push policies receive a git push payload including changed file paths as `input.push.affected_files`.
Write a Rego rule that checks whether any changed file matches a path prefix for IaC directories: `track { input.push.affected_files[_] == file; startswith(file, "infra/") }`.
Add an `ignore` rule that fires when no IaC file is changed: `ignore { count([f | f := input.push.affected_files[_]; startswith(f, "infra/")]) == 0 }`.
Attach the push policy to the target stack and push a commit that changes only a markdown file; confirm the run is ignored in the Spacelift UI.
Test the policy logic in the Spacelift policy simulator before attaching it to production stacks.
Combine with a `Trigger` policy to automatically start downstream stacks when a shared module changes.
Known gotchas
Push policies must return exactly one of `track`, `propose`, or `ignore`; if multiple outcomes evaluate to true, `ignore` takes precedence.
Spacelift evaluates push policies per stack; the same git push can trigger different outcomes on different stacks depending on which policies are attached.
The `input.push.affected_files` list reflects files changed in the push event, not the full diff relative to the last successful run; rebase-merged PRs may affect this list.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp