Skip to Content
Rule ReferenceYAML Syntax

YAML Syntax

Every TinyOps rule is defined as a single YAML file. This page covers the complete schema, required and optional fields, naming conventions, and a fully annotated example.

Rule Structure

A rule file has four top-level sections:

rule-structure.yaml
name: rule-name trigger: { ... } condition: { ... } # optional action: { ... }
FieldRequiredDescription
nameYesUnique identifier for the rule. Lowercase, hyphenated.
triggerYesThe event that starts execution. See Triggers.
conditionNoA check that must pass before the action runs. See Conditions.
actionYesThe operation to perform. See Actions.

Conditions are optional. If you omit the condition block, the action fires every time the trigger activates.

Naming Conventions

  • Rule names must be lowercase with hyphens separating words (e.g., stale-pr-alert, deploy-rollback).
  • Names should be descriptive and indicate what the rule does.
  • Names must be unique within an organization.

Field Reference

trigger

Defines when the rule executes. Exactly one trigger type must be specified.

trigger-field.yaml
trigger: type: schedule | webhook | poll # Additional fields depend on the type

See Triggers for full details on each type.

condition

Defines a check against a provider’s data. The action only runs if the condition passes.

condition-field.yaml
condition: provider: github | vercel | supabase check: string # provider-specific check name operator: string # comparison operator value: string | number | boolean # optional comparison value repo: string # optional, for GitHub provider

See Conditions for all operators and provider checks.

action

Defines what happens when the rule fires.

action-field.yaml
action: provider: github | vercel | slack | email method: string # provider-specific method name params: # method-specific parameters (object) key: value

Action params support template variables for dynamic values.

Complete Annotated Example

stale-pr-alert.yaml
# Rule name: unique identifier, lowercase with hyphens name: stale-pr-alert # Trigger: runs weekdays at 9:00 AM UTC trigger: type: schedule cron: "0 9 * * 1-5" # Condition: check if any PR is older than 3 days condition: provider: github check: pr.age operator: gt value: 3 repo: acme/webapp # Action: send a Slack notification action: provider: slack method: send_message params: channel: "#engineering" text: "There are stale PRs older than 3 days in acme/webapp. Current age: {{condition.result}} days."

Minimal Example (No Condition)

When you want an action to fire on every trigger without any check:

release-notification.yaml
name: release-notification trigger: type: webhook event: release source: generic action: provider: slack method: send_message params: channel: "#releases" text: "New release published at {{now}}. Payload: {{trigger.data}}"

Value Types

TypeExamplesUsed in
string"0 9 * * 1-5", "github.pull_request.opened"trigger fields, condition value, action params
number3, 50, 500condition value
booleantrue, falsecondition value
object{ channel: "#eng", text: "..." }action params

Cron expressions and strings containing special characters should always be wrapped in quotes to avoid YAML parsing issues.

Next Steps