Skip to content

Commit 41d870f

Browse files
authored
feat: 🚀 Added GCP authentication steps in tfdrift (#120)
1 parent 4f36a5f commit 41d870f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

.github/workflows/tfdrift.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ on:
2626
terraform_version:
2727
type: string
2828
default: 1.3.6
29-
description: 'Required erraform version '
29+
description: 'Required erraform version'
3030
secrets:
3131
AZURE_CREDENTIALS:
3232
required: false
@@ -43,6 +43,9 @@ on:
4343
build_role:
4444
required: false
4545
description: 'AWS OIDC role for aws authentication'
46+
GCP_CREDENTIALS:
47+
description: 'The Google Cloud JSON service account key to use for authentication'
48+
required: false
4649
GITHUB:
4750
required: true
4851
description: 'PAT of the user to run the jobs.'
@@ -88,6 +91,13 @@ jobs:
8891
role-duration-seconds: 900
8992
role-skip-session-tagging: true
9093

94+
# Authenticate to GCP
95+
- name: 'Authenticate to Google Cloud'
96+
if: ${{ inputs.provider == 'gcp' }}
97+
uses: 'google-github-actions/auth@v2'
98+
with:
99+
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
100+
91101
# Install azure-cli
92102
- name: Install Azure CLI
93103
if: ${{ inputs.provider == 'azurerm' }}

0 commit comments

Comments
 (0)