Skip to content

CICD-457 · Pull request cost comparison ​

Encyclopedia · FinOps and resource optimization · All snippets

Previous · CICD-456 · Next · CICD-458

1. Where it fits ​

  • Placement CI cost gate.
  • Prerequisites authorized read reports, explicit pricing period and reviewed ownership for cleanup.
  • Platforms local-linux, github-actions, gitea-actions.

2. Copy the snippet ​

bash
jq -es '.[0].totalMonthlyCost as $base | .[1].totalMonthlyCost as $next | (($next|tonumber)-($base|tonumber)) <= 100' baseline-estimate.json candidate-estimate.json

3. How it works ​

The expression filters or transforms the input JSON. Where jq -e is used, a false or empty result can fail the gate.

4. Verify the result ​

Use same cloud region, pricing date and currency. The example rejects estimated growth over 100 currency units.

Validation syntax-validated (Bash parse). Status definitions.