Skip to Content
Rule ReferenceConditions

Conditions

Conditions let you filter when a rule’s action should execute. After a trigger fires, the condition is evaluated against live data from a provider. The action only runs if the condition passes.

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

Schema

condition-schema.yaml
condition: provider: github | vercel | supabase check: string # provider-specific check name operator: string # comparison operator value: string | number | boolean # optional, depends on operator repo: string # optional, for GitHub provider
FieldTypeRequiredDescription
providerstringYesThe data source to check (github, vercel, or supabase)
checkstringYesProvider-specific metric or value to evaluate
operatorenumYesHow to compare the check result against value
valuestring, number, or booleanNoThe threshold or comparison value. Not required for operators like is_empty.
repostringNoRepository in owner/name format. Required for GitHub checks.

Operators

TinyOps provides 12 comparison operators:

OperatorDescriptionValue TypeExample
gtGreater thannumbervalue: 3 passes if result exceeds 3
ltLess thannumbervalue: 100 passes if result is under 100
eqEqual tostring, number, booleanvalue: "main" passes if result equals “main”
gteGreater than or equal tonumbervalue: 50 passes if result is 50 or more
lteLess than or equal tonumbervalue: 10 passes if result is 10 or less
containsContains substringstringvalue: "hotfix" passes if result contains “hotfix”
not_containsDoes not contain substringstringvalue: "WIP" passes if result does not contain “WIP”
matchesMatches regex patternstring (regex)value: "^feat/" passes if result matches pattern
none_matchNo items in list matchstring (regex)value: "critical" passes if no items match
any_matchAt least one item matchesstring (regex)value: "approved" passes if any item matches
is_emptyValue is empty or null(none)Passes if result is empty, null, or zero-length
is_not_emptyValue is not empty(none)Passes if result has content

The operators is_empty and is_not_empty do not require a value field. All other operators need a value for comparison.


Provider Checks

GitHub

GitHub checks require the repo field in owner/name format.

CheckReturnsDescription
pr.agenumber (days)Age of the oldest open pull request in days
pr.lines_changednumberTotal lines changed in the triggering PR
repo.open_prsnumberCount of currently open pull requests

Example: Stale PR Detection

stale-pr-check.yaml
condition: provider: github check: pr.age operator: gt value: 3 repo: acme/webapp

Example: Large PR Warning

large-pr-check.yaml
condition: provider: github check: pr.lines_changed operator: gt value: 500

Vercel

Vercel checks operate at the organization/account level.

CheckReturnsDescription
billing.mtdnumber (USD)Month-to-date spend in dollars
billing.projectednumber (USD)Projected spend for the current billing period

Example: Cost Spike Alert

cost-spike-check.yaml
condition: provider: vercel check: billing.mtd operator: gt value: 50

Example: Budget Forecast

budget-forecast-check.yaml
condition: provider: vercel check: billing.projected operator: gte value: 200

Supabase

Supabase checks operate on your database instance.

CheckReturnsDescription
table.row_countnumberNumber of rows in the monitored table
db.sizenumber (MB)Total database size in megabytes

Example: Table Growth

table-growth-check.yaml
condition: provider: supabase check: table.row_count operator: gt value: 100000

Example: Database Size

db-size-check.yaml
condition: provider: supabase check: db.size operator: gt value: 500

Operator Usage by Type

Numeric operators compare against number values:

numeric-operators.yaml
# Greater than condition: provider: vercel check: billing.mtd operator: gt value: 50 # Less than or equal to condition: provider: supabase check: db.size operator: lte value: 1000

Condition Results

When a condition passes, the evaluated result is available as {{condition.result}} in your action params. This lets you include the actual value in notifications.

result-in-action.yaml
condition: provider: github check: pr.age operator: gt value: 3 repo: acme/webapp action: provider: slack method: send_message params: channel: "#engineering" text: "Oldest PR is {{condition.result}} days old."

See Template Variables for all available variables.


Rules Without Conditions

If your rule should always fire when triggered, simply omit the condition block:

no-condition.yaml
name: deploy-rollback trigger: type: webhook event: github.workflow_run.completed source: github # No condition block - action fires on every trigger action: provider: vercel method: rollback params: {}

Next Steps