-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (37 loc) · 1.15 KB
/
Copy pathterraform.yml
File metadata and controls
47 lines (37 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Terraform Plan
on:
push:
paths:
- "iac/**"
- ".github/workflows/terraform.yml"
jobs:
build:
runs-on: ubuntu-latest
# Add "id-token" with the intended permissions.
permissions:
contents: "read"
id-token: "write"
steps:
- uses: actions/checkout@v3
- uses: hashicorp/setup-terraform@v2
- name: "Create env file"
run: |
echo "${{ secrets.ENV_FILE }}" > .env.cicd
echo "${{ secrets.ENV_FILE }}" > .env
- id: "auth"
name: "Authenticate to Google Cloud"
uses: "google-github-actions/auth@v1"
with:
workload_identity_provider: projects/${{ secrets.PROJECT_ID }}/locations/global/workloadIdentityPools/github-pool/providers/github-provider
service_account: github-actions@${{ secrets.PROJECT }}.iam.gserviceaccount.com
- name: Terraform Version
id: version
run: make iac-version
- name: tfsec
id: security
uses: aquasecurity/tfsec-action@v1.0.0
continue-on-error: true
- name: Terraform Plan
id: plan
run: make iac-plan
continue-on-error: true