-
Notifications
You must be signed in to change notification settings - Fork 0
33 lines (31 loc) · 1.15 KB
/
validate-tf-samples.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
name: validate-terraform-samples
on:
pull_request:
paths:
- "assets/queries/terraform/**/**/test/*.tf"
jobs:
lint-samples:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- name: Get tflint
env:
TFLINT_RELEASE_URL: https://github.com/terraform-linters/tflint/releases/latest/download/tflint_linux_amd64.zip
run: |
mkdir -p .bin
PROJDIR=$(pwd)
cd .bin && wget -q "${TFLINT_RELEASE_URL}" \
&& unzip $(basename "${TFLINT_RELEASE_URL}") \
&& chmod +x tflint \
&& rm -vf $(basename "${TFLINT_RELEASE_URL}") \
&& cd "${PROJDIR}"
- name: Run tflint
run: |
python3 -u .github/scripts/samples-linters/validate-syntax.py \
"assets/queries/terraform/**/**/test/*.tf" \
--linter .bin/tflint \
--skip '.github/scripts/samples-linters/ignore-list/terraform' \
--verbose --tmp --redirect \
--extra '--config .github/scripts/samples-linters/.tflint.hcl --filter'