Skip to content

feat: upgrade gha workflows #66

feat: upgrade gha workflows

feat: upgrade gha workflows #66

Workflow file for this run

name: Terramate with Infracost
on:
pull_request:
jobs:
preview:
name: Plan
runs-on: ubuntu-latest
permissions:
id-token: write
contents: write
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install tools using asdf
uses: asdf-vm/actions/[email protected]
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: eu-central-1
- name: Setup Infracost
uses: infracost/actions/setup@v3
with:
api-key: ${{ secrets.INFRACOST_API_KEY }}
- name: Create Terraform plan on changed stacks
run: |
terramate run terraform init
terramate run terraform validate
terramate run terraform plan -out ./out.tfplan
- name: Generate Infracost cost estimate baseline
run: |
terramate run infracost breakdown \
--path ./out.tfplan \
--format=json \
--usage-file infracost-usage-medium.yml \
--out-file=./infracost-base.json
- name: Post Infracost comment
run: |
terramate run infracost comment github \
--path=./infracost-base.json \
--repo=$GITHUB_REPOSITORY \
--github-token=${{github.token}} \
--pull-request=${{github.event.pull_request.number}} \
--behavior=new