Skip to content

Commit 41d0c43

Browse files
committed
feat: removed the old required params for gcp auth stage
1 parent 8202eca commit 41d0c43

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

.github/workflows/gitops.yml

+15-9
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@ on:
1010
defaults:
1111
run:
1212
working-directory: ./tf-variables/
13+
env:
14+
TERRAFORM_VER: 1.8.0
15+
TERRAFORM_DIR: ./tf-variables
16+
CLOUDSDK_VER: 480.0.0
1317
permissions:
1418
pull-requests: write
1519
jobs:
@@ -26,17 +30,19 @@ jobs:
2630
id: checkout_code
2731
uses: actions/checkout@v2
2832

29-
# Static code analysis
33+
# Static code analysis using aqua security's tfsec
3034
- name: Run tfsec scan
3135
id: static_code_analysis
3236
uses: aquasecurity/tfsec-action@v1.0.3
3337
with:
34-
path: .
38+
path: ${{ env.TERRAFORM_DIR }}
3539

3640
# Install the latest version of Google Cloud SDK
3741
- id: cloud_sdk_installation
3842
name: Set up Cloud SDK
3943
uses: google-github-actions/setup-gcloud@v0.3.0
44+
with:
45+
version: ${{ env.CLOUDSDK_VER }}
4046

4147
# Setup the authentication for the Google Cloud using WIF
4248
- id: gcp_auth
@@ -52,27 +58,27 @@ jobs:
5258
name: Terraform Installation
5359
uses: hashicorp/setup-terraform@v3
5460
with:
55-
terraform_version: "1.8.0"
61+
terraform_version: ${{ env.TERRAFORM_VER }}
5662

5763
# Checks that Terraform configuration files adhere to a canonical format
5864
- name: Terraform fmt
59-
id: fmt
65+
id: tf_fmt
6066
run: terraform fmt -check
6167
continue-on-error: true
6268

6369
# Initialize the Terraform working directory
6470
- name: Terraform Init
65-
id: init
71+
id: tf_init
6672
run: terraform init
6773

6874
# Validate the terraform configuration files
6975
- name: Terraform Validate
70-
id: validate
76+
id: tf_validate
7177
run: terraform validate -no-color
7278

7379
# Generates an execution plan for Terraform
7480
- name: Terraform Plan
75-
id: plan
81+
id: tf_plan
7682
run: terraform plan -no-color
7783
continue-on-error: true
7884

@@ -115,8 +121,8 @@ jobs:
115121
body: output
116122
})
117123

118-
# Generates an execution plan for Terraform
124+
# Executes the apply operation to deploy the actual infrastructure
119125
- name: Terraform Apply
120-
id: apply
126+
id: tf_apply
121127
if: github.ref == 'refs/heads/"master"' && github.event_name == 'push'
122128
run: terraform apply -auto-approve

0 commit comments

Comments
 (0)