Skip to content

Commit

Permalink
fix: move credentials setup before init
Browse files Browse the repository at this point in the history
  • Loading branch information
dnlopes committed Jul 20, 2024
1 parent b5fed34 commit c7c2bf2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/terraform.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ jobs:
id: fmt
run: ${{ inputs.binary }} fmt -recursive -diff -check

- name: Configure AWS Credentials
if: ${{ inputs.runPlanOrApply }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.awsRoleArn }}
aws-region: eu-west-1
role-session-name: ${{ inputs.terraformWorkspace }}

- name: Init
id: init
run: |
Expand All @@ -128,14 +136,6 @@ jobs:
id: verify_lockfile
run: git --no-pager diff --exit-code .terraform.lock.hcl

- name: Configure AWS Credentials
if: ${{ inputs.runPlanOrApply }}
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ inputs.awsRoleArn }}
aws-region: eu-west-1
role-session-name: ${{ inputs.terraformWorkspace }}

- name: ${{ inputs.terraformAction }}
if: ${{ inputs.runPlanOrApply }}
id: plan_or_apply
Expand Down

0 comments on commit c7c2bf2

Please sign in to comment.