Skip to content

Update terraform-docs/gh-actions action to v1.3.0 #53

Update terraform-docs/gh-actions action to v1.3.0

Update terraform-docs/gh-actions action to v1.3.0 #53

Workflow file for this run

name: 'run-pre-commit-hooks'
# This workflow runs the pre-commit hooks defined in .pre-commit-config.yaml
on:
pull_request:
branches: [main]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
runs-on: ${{ matrix.os }}
env:
GO_VERSION: ${{ matrix.go }}
TF_VERSION: ${{ matrix.tf }}
TFLINT_VERSION: ${{ matrix.tflint }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
strategy:
matrix:
os: [ubuntu-latest]
tf: [1.4.0]
tflint: [v0.47.0]
go: ['1.20']
permissions:
pull-requests: write
id-token: write
contents: read
steps:
- name: Checkout from Github
uses: actions/checkout@v4
- name: Install Python3
uses: actions/setup-python@v5
- name: Install tflint
uses: terraform-linters/setup-tflint@v4
with:
tflint_version: ${{ env.TFLINT_VERSION }}
- name: Cache tflint plugin dir
uses: actions/cache@v4
with:
path: ~/.tflint.d/plugins
key: ${{ matrix.os }}-tflint-${{ hashFiles('.tflint.hcl') }}
- name: Install Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_version: ${{ env.TF_VERSION }}
- name: Config Terraform plugin cache
run: |
echo 'plugin_cache_dir="$HOME/.terraform.d/plugin-cache"' >~/.terraformrc
mkdir --parents ~/.terraform.d/plugin-cache
- name: Cache Terraform
uses: actions/cache@v4
with:
path: |
~/.terraform.d/plugin-cache
key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }}
restore-keys: |
${{ runner.os }}-terraform-
- name: Install tfsec
uses: jaxxstorm/[email protected]
with:
repo: aquasecurity/tfsec
platform: linux
arch: amd64
- uses: actions/setup-go@v5
with:
go-version: ${{ env.GO_VERSION }}
- name: Install shfmt
run: go install mvdan.cc/sh/v3/cmd/shfmt@latest
- uses: pre-commit/[email protected]