| name | castai-ci-integration |
| description | Integrate CAST AI policy validation and cost checks into CI/CD pipelines.
Use when adding CAST AI savings verification to GitHub Actions,
validating Terraform plans, or gating deployments on cost thresholds.
Trigger with phrases like "cast ai CI", "cast ai github actions",
"cast ai terraform CI", "cast ai pipeline".
|
| allowed-tools | Read, Write, Edit, Bash(gh:*) |
| version | 1.4.0 |
| license | MIT |
| author | Jeremy Longshore <jeremy@intentsolutions.io> |
| tags | ["saas","kubernetes","cost-optimization","castai"] |
| compatibility | Designed for Claude Code |
CAST AI CI Integration
Overview
Add CAST AI cost validation to CI/CD pipelines: verify savings thresholds, validate Terraform plans before apply, and gate deployments on autoscaler health.
Prerequisites
- GitHub Actions enabled
- CAST AI API key stored as repository secret
- Terraform state accessible from CI (if using Terraform)
Instructions
Step 1: GitHub Actions -- Savings Gate
name: CAST AI Cost Check
on:
pull_request:
paths: ["terraform/**", "k8s/**"]
schedule:
- cron: "0 8 * * 1"
jobs:
cost-check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Check CAST AI Savings
env:
CASTAI_API_KEY: ${{ secrets.CASTAI_API_KEY }}
CASTAI_CLUSTER_ID: ${{ secrets.CASTAI_CLUSTER_ID }}
run: |
SAVINGS=$(curl -s -H "X-API-Key: ${CASTAI_API_KEY}" \
"https://api.cast.ai/v1/kubernetes/clusters/${CASTAI_CLUSTER_ID}/savings")
PERCENT=$(echo
[ ]