Skip to content

Commit 5829536

Browse files
authored
modify workflow
1 parent 78c94a8 commit 5829536

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

.github/workflows/terraform-plan.yml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,25 +60,24 @@ jobs:
6060
run: terraform show -json tfplan.out > ../../tfplan.json && pwd
6161
working-directory: ./terraform
6262

63-
# Checkout the branch you want Infracost to compare costs against, most commonly the target branch.
64-
- name: Checkout base branch
65-
uses: actions/checkout@v4
66-
with:
67-
ref: '${{ github.event.pull_request.base.ref }}'
6863
- name: Setup Infracost
6964
uses: infracost/actions/setup@v3
7065
with:
7166
api-key: ${{ secrets.INFRACOST_API_KEY }}
7267
- name: Run Infracost
7368
run: |
74-
infracost breakdown --path=. --format=json --out-file=/tmp/infracost-base.json && pwd && cat /tmp/infracost-base.json
69+
infracost breakdown --path=../tfplan.json --format=json --out-file=/tmp/infracost.json && pwd && cat /tmp/infracost.json
7570
76-
# Checkout the current PR branch so we can create a diff.
77-
- name: Checkout PR branch
71+
# Checkout the branch you want Infracost to compare costs against, most commonly the target branch.
72+
- name: Checkout base branch
7873
uses: actions/checkout@v4
74+
with:
75+
ref: '${{ github.event.pull_request.base.ref }}'
76+
7977
- name: Run Infracost
8078
shell: bash
8179
run: |
80+
infracost breakdown --path=./terraform --format=json --out-file=/tmp/infracost-base.json && pwd && cat /tmp/infracost-base.json
8281
infracost diff --path=../tfplan.json \
8382
--format=json \
8483
--compare-to=/tmp/infracost-base.json \

0 commit comments

Comments
 (0)