Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name: Pre-Commit

on:
workflow_call:
inputs:
trivy_scan_ref:
description: "Path Trivy scans in the terraform_trivy job. Narrow to e.g. 'terraform' to skip app dependency/Dockerfile scanning."
type: string
required: false
default: "."

env:
PY_VERSION: "3.x"
Expand Down Expand Up @@ -120,6 +126,15 @@ jobs:
needs:
[terraform_fmt, check-yaml, terraform_tflint, terraform_docs]
steps:
# terraform_validate runs `terraform init` in every module directory, and each
# one downloads its own copy of the provider plugins (the aws provider alone is
# ~700 MB unpacked). On repos with many modules this exhausts the runner's ~14 GB
# disk ("no space left on device"). Reclaim space by removing preinstalled
# toolchains this job never uses. Purely additive: a no-op for small repos.
- name: Free up disk space
run: |
sudo rm -rf /usr/local/lib/android /usr/share/dotnet /opt/ghc /usr/local/.ghcup /usr/share/swift
df -h /
- uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5
with:
go-version: ${{ env.GO_VERSION }}
Expand Down Expand Up @@ -180,6 +195,7 @@ jobs:
uses: aquasecurity/trivy-action@master
with:
scan-type: "fs"
scan-ref: ${{ inputs.trivy_scan_ref }}
hide-progress: false
exit-code: "1"
scanners: "vuln,secret,misconfig"
Expand Down
15 changes: 11 additions & 4 deletions precommit-config/.tflint.hcl
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# signature = "pgp" pins plugin verification to the legacy PGP key instead of the default
# "auto", which prefers GitHub attestations. GitHub REST API 2026-03-10 dropped the `bundle`
# field from attestation list responses; tflint unmarshals the resulting null into a nil
# *bundle.Bundle without erroring and then panics dereferencing it during `tflint --init`.
# Upstream: https://github.com/terraform-linters/tflint/issues/2591
# Drop this line once that lands and the tflint we install carries the fix.
plugin "aws" {
enabled = true
version = "0.40.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
}
enabled = true
version = "0.40.0"
source = "github.com/terraform-linters/tflint-ruleset-aws"
signature = "pgp"
}