File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4242 secrets :
4343 TF_API_TOKEN :
4444 required : true
45+ ANTHROPIC_API_KEY :
46+ required : false
4547
4648permissions :
4749 contents : read
4850 id-token : write
51+ pull-requests : write
4952
5053concurrency : deploy-${{ inputs.stage }}
5154
@@ -106,7 +109,25 @@ jobs:
106109
107110 - name : Plan ${{ inputs.stage }}
108111 working-directory : ${{ inputs.tf-directory }}
109- run : terraform plan -no-color
112+ run : |
113+ set -o pipefail
114+ terraform plan -no-color 2>&1 | tee /tmp/plan_output.txt
115+
116+ - name : Upload Plan Output
117+ if : always() && github.event_name == 'pull_request'
118+ uses : actions/upload-artifact@v4
119+ with :
120+ name : terraform-plan-${{ inputs.stage }}
121+ path : /tmp/plan_output.txt
122+ retention-days : 1
123+
124+ - name : Claude AI Review
125+ if : github.event_name == 'pull_request' && secrets.ANTHROPIC_API_KEY != ''
126+ continue-on-error : true
127+ uses : WalletConnect/actions/claude/terraform-plan-review@master
128+ with :
129+ anthropic_api_key : ${{ secrets.ANTHROPIC_API_KEY }}
130+ terraform_plan_file : /tmp/plan_output.txt
110131
111132 - name : Delete Grafana key
112133 if : ${{ always() }}
Original file line number Diff line number Diff line change @@ -108,10 +108,14 @@ on:
108108 secrets :
109109 TF_API_TOKEN :
110110 required : true
111+ ANTHROPIC_API_KEY :
112+ required : false
113+ description : ' Anthropic API key for Claude AI terraform plan review'
111114
112115permissions :
113116 contents : read
114117 id-token : write
118+ pull-requests : write
115119
116120jobs :
117121 check-app :
You can’t perform that action at this time.
0 commit comments