Skip to content

Commit ba461cc

Browse files
feat: Add cost-analysis job to workflow
- Add overmindtech/cost-signals-action@v1 to run parallel with policy checks - Creates separate terraform plan for cost analysis - Will detect cost changes from t3.micro → t3.small upgrade - Provides financial context alongside policy and blast radius analysis
1 parent 2167490 commit ba461cc

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

.github/workflows/automatic.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,3 +133,31 @@ jobs:
133133
if: (success() || failure() || cancelled()) && github.event.pull_request.merged == true
134134
with:
135135
ovm-api-key: ${{ secrets.OVM_API_KEY }}
136+
137+
cost-analysis:
138+
runs-on: ubuntu-latest
139+
if: github.event.action != 'closed'
140+
permissions:
141+
contents: read
142+
id-token: write
143+
pull-requests: write
144+
steps:
145+
- uses: actions/checkout@v4
146+
147+
- name: Terraform Init
148+
uses: ./.github/actions/terraform_init/
149+
with:
150+
terraform_deploy_role: ${{ vars.TERRAFORM_DEPLOY_ROLE }}
151+
152+
- name: Terraform Plan for Cost Analysis
153+
id: plan-cost
154+
run: |
155+
set -o pipefail -ex
156+
terraform plan -compact-warnings -no-color -input=false -lock-timeout=5m -out tfplan-cost 2>&1
157+
terraform show -json tfplan-cost > tfplan-cost.json
158+
159+
- uses: overmindtech/cost-signals-action@v1
160+
with:
161+
overmind-api-key: ${{ secrets.OVM_API_KEY }}
162+
infracost-api-key: ${{ secrets.INFRACOST_API_KEY }}
163+
terraform-plan-json: ./tfplan-cost.json

0 commit comments

Comments
 (0)