-
Notifications
You must be signed in to change notification settings - Fork 0
38 lines (37 loc) · 1018 Bytes
/
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
---
name: Run PreCommit
on:
push:
branchs-ignore:
- master
jobs:
pre-commit:
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; (cd $i; tofu init); done
- name: Run Pre-Commit
run: >
pre-commit run
--all-files
--show-diff-on-failure
-v