Skip to content

Commit

Permalink
feat: Added GCP authentication step for tf-checks (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tanveer143s authored Nov 27, 2023
1 parent 6f7c6fc commit 05ebccf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/tf-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ on:
required: false
default: false
type: string
gcp_credentials:
description: 'GCP credentials to use.'
required: false
default: false
type: string
secrets:
AWS_ACCESS_KEY_ID:
description: 'aws access keys'
required: false
AWS_SECRET_ACCESS_KEY:
description: 'aws secret access keys'
required: false
GCP_CREDENTIALS:
description: 'The Google Cloud JSON service account key to use for authentication'
required: false


jobs:
# - Terraform version extract as output.
Expand Down Expand Up @@ -74,6 +83,12 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: us-east-1

- name: 'Authenticate to Google Cloud'
if: ${{ inputs.gcp_credentials == 'true' }}
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'

# - Installing terraform version based on version extract.
- name: Install Terraform v${{ inputs.terraform_version || needs.versionExtract.outputs.maxVersion }}
uses: hashicorp/setup-terraform@v3
Expand Down

0 comments on commit 05ebccf

Please sign in to comment.