Skip to content

Commit b59f733

Browse files
authored
feat: updated gcp auth input & secrets (#137)
1 parent ec6886f commit b59f733

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

.github/workflows/terraform_workflow.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,20 @@ on:
4747
type: string
4848
default: 1
4949
description: 'Minimum approvals required to accept the plan'
50+
token_format:
51+
required: false
52+
type: string
53+
default: access_token
54+
description: 'Output format for the generated authentication token. For OAuth 2.0 access tokens, specify "access_token". For OIDC tokens, specify "id_token". To skip token generation, leave this value empty'
55+
access_token_lifetime:
56+
required: false
57+
type: string
58+
default: 300s
59+
description: 'Desired lifetime duration of the access token, in seconds'
60+
project_id:
61+
required: false
62+
type: string
63+
description: 'ID of the default project to use for future API calls and invocations.'
5064
secrets:
5165
AZURE_CREDENTIALS:
5266
required: false
@@ -72,6 +86,12 @@ on:
7286
env-vars:
7387
required: false
7488
description: 'Pass required environment variables'
89+
WORKLOAD_IDENTITY_PROVIDER:
90+
required: false
91+
description: 'The full identifier of the Workload Identity Provider'
92+
SERVICE_ACCOUNT:
93+
required: false
94+
description: 'The service account to be used'
7595

7696
jobs:
7797
terraform-workflow:
@@ -114,6 +134,11 @@ jobs:
114134
uses: 'google-github-actions/auth@v2'
115135
with:
116136
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
137+
token_format: ${{ inputs.token_format }}
138+
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
139+
service_account: ${{ secrets.SERVICE_ACCOUNT }}
140+
access_token_lifetime: ${{ inputs.access_token_lifetime }}
141+
project_id: ${{ inputs.project_id }}
117142

118143
- name: Install doctl
119144
if: ${{ inputs.provider == 'digitalocean' }}

.github/workflows/tfdrift.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,20 @@ on:
2727
type: string
2828
default: 1.3.6
2929
description: 'Required erraform version'
30+
token_format:
31+
required: false
32+
type: string
33+
default: access_token
34+
description: 'Output format for the generated authentication token. For OAuth 2.0 access tokens, specify "access_token". For OIDC tokens, specify "id_token". To skip token generation, leave this value empty'
35+
access_token_lifetime:
36+
required: false
37+
type: string
38+
default: 300s
39+
description: 'Desired lifetime duration of the access token, in seconds'
40+
project_id:
41+
required: false
42+
type: string
43+
description: 'ID of the default project to use for future API calls and invocations.'
3044
secrets:
3145
AZURE_CREDENTIALS:
3246
required: false
@@ -55,6 +69,12 @@ on:
5569
env-vars:
5670
required: false
5771
description: 'Pass required environment variables'
72+
WORKLOAD_IDENTITY_PROVIDER:
73+
required: false
74+
description: 'The full identifier of the Workload Identity Provider'
75+
SERVICE_ACCOUNT:
76+
required: false
77+
description: 'The service account to be used'
5878

5979
jobs:
6080
terraform-plan:
@@ -97,6 +117,11 @@ jobs:
97117
uses: 'google-github-actions/auth@v2'
98118
with:
99119
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
120+
token_format: ${{ inputs.token_format }}
121+
workload_identity_provider: ${{ secrets.WORKLOAD_IDENTITY_PROVIDER }}
122+
service_account: ${{ secrets.SERVICE_ACCOUNT }}
123+
access_token_lifetime: ${{ inputs.access_token_lifetime }}
124+
project_id: ${{ inputs.project_id }}
100125

101126
# Install azure-cli
102127
- name: Install Azure CLI

0 commit comments

Comments
 (0)