From 084bd6665a50587976ddfb9bd29f2c5f8147008c Mon Sep 17 00:00:00 2001 From: Okesanya Odunayo <94924061+DrInTech22@users.noreply.github.com> Date: Wed, 11 Dec 2024 00:34:21 +0100 Subject: [PATCH] modify --- .github/workflows/terraform-plan.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/terraform-plan.yml b/.github/workflows/terraform-plan.yml index f5d9bbb..8720b36 100644 --- a/.github/workflows/terraform-plan.yml +++ b/.github/workflows/terraform-plan.yml @@ -66,7 +66,7 @@ jobs: api-key: ${{ secrets.INFRACOST_API_KEY }} - name: Run Infracost run: | - infracost breakdown --path=./terraform --format=json --out-file=/tmp/infracost.json && pwd && cat /tmp/infracost.json + infracost breakdown --path=./terraform --format=json --out-file=/tmp/infracost-new.json && pwd && cat /tmp/infracost-new.json # Checkout the branch you want Infracost to compare costs against, most commonly the target branch. - name: Checkout base branch @@ -77,10 +77,9 @@ jobs: - name: Run Infracost shell: bash run: | - infracost breakdown --path=./terraform --format=json --out-file=/tmp/infracost-base.json && pwd && cat /tmp/infracost-base.json - infracost diff --path=../tfplan.json \ + infracost diff --path=./terraform \ --format=json \ - --compare-to=/tmp/infracost-base.json \ + --compare-to=/tmp/infracost-new.json \ --out-file=/tmp/infracost.json && cat /tmp/infracost.json - name: Post Infracost Comment @@ -89,4 +88,4 @@ jobs: --repo=$GITHUB_REPOSITORY \ --github-token=${{ github.token }} \ --pull-request=${{ github.event.pull_request.number }} \ - --behavior=update + --behavior=update \ No newline at end of file