-
Notifications
You must be signed in to change notification settings - Fork 1
83 lines (71 loc) · 2.02 KB
/
ci.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
---
permissions:
statuses: write
name: Lint Code Base
# yamllint disable rule:truthy
on:
schedule:
- cron: "00 20 * * 0"
workflow_dispatch:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list
# of changed files within `super-linter`
fetch-depth: 0
# https://github.com/marketplace/actions/super-linter
- name: Lint Code Base
uses: github/super-linter@v4
env:
VALIDATE_ALL_CODEBASE: true
VALIDATE_JSCPD: false
VALIDATE_TERRAFORM_TERRASCAN: false
VALIDATE_GITLEAKS: false
VALIDATE_DOCKERFILE_HADOLINT: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
precommit:
name: pre-commit
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
# Full git history is needed to get a proper list
# of changed files within `super-linter`
fetch-depth: 0
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.9'
cache: 'pip' # caching pip dependencies
- name: Install Python packages
run: pip install -r requirements.txt
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v2
with:
tflint_version: latest
- name: Patch .pre-commit-config.yaml
run: |
sed -i '/terraform-docs/,+4d' \
"$GITHUB_WORKSPACE/.pre-commit-config.yaml"
sed -i '/- id: end-of-file-fixer/d' \
"$GITHUB_WORKSPACE/.pre-commit-config.yaml"
- name: Pre-commit check all files
run: |
pre-commit install
pre-commit install-hooks
tflint --init
tflint --version
pre-commit run --all-files