Skip to content

Commit 23e0fbf

Browse files
committed
chore: move canonical pre-commit config from images repo
1 parent bc31b1a commit 23e0fbf

File tree

3 files changed

+52
-3
lines changed

3 files changed

+52
-3
lines changed

.github/workflows/opentofu.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ jobs:
5959
- name: Fetch canonical pre-commit config
6060
run: |
6161
curl -sSL -o .pre-commit-config.yaml \
62-
https://raw.githubusercontent.com/makeitworkcloud/images/main/tfroot-runner/pre-commit-config.yaml
62+
https://raw.githubusercontent.com/makeitworkcloud/shared-workflows/main/tfroot-pre-commit-config.yaml
6363
6464
- name: Initialize OpenTofu
6565
run: tofu init -backend=false

AGENTS.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,12 @@ Agents are authorized to push directly to `main` in this repository.
1414

1515
Reusable workflow for OpenTofu/Terraform root module repositories (`tfroot-*`). It:
1616

17-
1. Fetches canonical pre-commit config from `makeitworkcloud/images` repo
17+
1. Fetches canonical pre-commit config from `tfroot-pre-commit-config.yaml` in this repo
1818
2. Runs pre-commit tests using the `tfroot-runner` container image
1919
3. Posts plan output as PR comments
2020
4. Applies on merge to main
2121

22-
**Pre-commit configuration is centralized** in `makeitworkcloud/images/tfroot-runner/pre-commit-config.yaml`. Do not add `.pre-commit-config.yaml` to individual tfroot repos.
22+
**Pre-commit configuration is centralized** in `tfroot-pre-commit-config.yaml`. Do not add `.pre-commit-config.yaml` to individual tfroot repos.
2323

2424
### Workflow Inputs
2525

tfroot-pre-commit-config.yaml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Canonical pre-commit configuration for tfroot-* repositories.
2+
# This file is bundled into the tfroot-runner container image to pre-cache hooks.
3+
# It is also fetched by the shared OpenTofu workflow at CI time.
4+
#
5+
# To update hooks for all tfroot repos, modify this file and rebuild the image.
6+
repos:
7+
- repo: https://github.com/compilerla/conventional-pre-commit
8+
rev: v4.3.0
9+
hooks:
10+
- id: conventional-pre-commit
11+
stages: [commit-msg]
12+
- repo: https://github.com/antonbabenko/pre-commit-terraform
13+
rev: v1.105.0
14+
hooks:
15+
- id: terraform_validate
16+
args:
17+
- --hook-config=--retry-once-with-cleanup=true
18+
- --args=-no-color
19+
- --tf-init-args=-reconfigure
20+
- --tf-init-args=-upgrade
21+
- --tf-init-args=-backend=false
22+
- id: terraform_tflint
23+
args:
24+
- --args=--minimum-failure-severity=error
25+
- --args=--config=__GIT_WORKING_DIR__/.tflint.hcl
26+
- id: terraform_checkov
27+
args:
28+
- --args=--config-file __GIT_WORKING_DIR__/.checkov.yml
29+
- id: terraform_fmt
30+
args:
31+
- --args=-no-color
32+
- --args=-diff
33+
- --args=-recursive
34+
- id: terraform_docs
35+
args:
36+
- --args=--config=.terraform-docs.yml
37+
- repo: https://github.com/pre-commit/pre-commit-hooks
38+
rev: v6.0.0
39+
hooks:
40+
- id: check-case-conflict
41+
- id: check-merge-conflict
42+
- id: check-symlinks
43+
- id: check-vcs-permalinks
44+
- id: destroyed-symlinks
45+
- id: detect-private-key
46+
- id: end-of-file-fixer
47+
exclude: README.md
48+
- id: mixed-line-ending
49+
- id: trailing-whitespace

0 commit comments

Comments
 (0)