-
Notifications
You must be signed in to change notification settings - Fork 0
41 lines (40 loc) · 1.1 KB
/
pre-commit.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
---
name: Run PreCommit
on:
# pull_request:
# types: [opened, synchronize, reopened, ready_for_review]
push:
path:
.github
jobs:
pre-commit:
# if: github.event.pull_request.draft == false
name: pre-commit checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Open Tofu
run: |
curl --proto '=https' --tlsv1.2 \
-fsSL https://get.opentofu.org/install-opentofu.sh \
-o install-opentofu.sh
chmod +x install-opentofu.sh
./install-opentofu.sh --install-method deb
rm -f install-opentofu.sh
- name: Install precommit
run: |
python -m pip install pre-commit
- name: Install hooks
run: |
pre-commit install --install-hooks
- name: Init providers
run: |
l=$(find . -maxdepth 1 -type d -name "[a-z]*")
for i in ${l[@]} ;do echo $i; tofu init $i; done
- name: Run Pre-Commit
run: >
pre-commit run
--all-files
--show-diff-on-failure
-v