-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (39 loc) · 1.07 KB
/
pre-commit.yml
File metadata and controls
47 lines (39 loc) · 1.07 KB
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
name: Pre-commit
on:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for pre-commit hooks
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Set up OpenTofu
uses: opentofu/setup-opentofu@v1
with:
tofu_version: latest
- uses: wagoid/commitlint-github-action@v6
with:
failOnWarnings: true # Strict mode
configFile: .github/.commitlintrc.mjs
- name: Run pre-commit on PRs
if: github.event_name == 'pull_request'
uses: pre-commit/action@v3.0.1
env:
PCT_TFPATH: tofu
- name: Run pre-commit on push to main
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: pre-commit/action@v3.0.1
env:
PCT_TFPATH: tofu
SKIP: no-commit-to-branch