-
-
Notifications
You must be signed in to change notification settings - Fork 4
69 lines (54 loc) · 2.07 KB
/
terraform.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
---
name: Terraform
# yamllint disable-line rule:truthy
on:
pull_request:
permissions:
id-token: write # This is required for requesting the JWT
contents: read # This is required for actions/checkout
jobs:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
terraform: [1.0.0, latest]
directories: [".", "examples/cost", "examples/simple", "examples/full"]
defaults:
run:
working-directory: ${{ matrix.directories }}
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: hashicorp/setup-terraform@633666f66e0061ca3b725c73b2ec20cd13a8fdd1 # v2.0.3
with:
terraform_version: ${{ matrix.terraform }}
- run: terraform -version
- run: terraform init -input=false -backend=false
- run: terraform validate
tflint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: actions/cache@6998d139ddd3e68c71e9e398d8e40b71a2f39812 # v3.2.5
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.config/tflint.hcl') }}
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@67fbcbb121271f7775d2e7715933280b06314838 # v1.7.0
with:
role-to-assume: ${{ secrets.TFLINT_ROLE_ARN }}
role-session-name: tflint
aws-region: ${{ secrets.TFLINT_AWS_REGION }}
- name: install tflint
run: |
# renovate: datasource=github-tags depName=terraform-linters/tflint
tflint_version="v0.49.0"
curl -o tflint.zip -L https://github.com/terraform-linters/tflint/releases/download/${tflint_version}/tflint_linux_amd64.zip
unzip tflint.zip
- name: Show version
run: ./tflint --config=.config/tflint.hcl --version
- name: Init TFLint
run: ./tflint --config=.config/tflint.hcl --init
- name: Run TFLint
run: ./tflint --config=.config/tflint.hcl -f compact