-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (40 loc) · 1.15 KB
/
terraform-validate-only.yml
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
48
49
name: 'Terraform Validate Only'
on:
push:
branches-ignore:
- main
paths:
- devops/envs/prod-unicc/*
permissions:
contents: read
jobs:
terraform:
name: 'Terraform'
runs-on: ubuntu-latest
defaults:
run:
working-directory: devops/envs/prod-unicc/
steps:
# Checkout the repository to the GitHub Actions runner
- name: Checkout
uses: actions/checkout@v3
# Step up Terraform
- uses: hashicorp/setup-terraform@v3
- name: Terraform Format
id: fmt
run: terraform fmt -check
continue-on-error: true
- name: Terraform Init
id: init
run: |
sed -i "s|[email protected]:awsopda/who-|https://github.com/finddx/|" ./*
rm -f backend.tf
echo "machine github.com login x password ${MY_GH_TOKEN}" > ~/.netrc
git config --global url."https://github.com/".insteadOf "git://github.com/"
git config --global advice.detachedHead false
terraform init -input=false
env:
MY_GH_TOKEN: ${{secrets.PAT_FINE_GRAINED}}
- name: Terraform Validate
id: validate
run: terraform validate -no-color