Skip to content

Merge pull request #7 from rabiloo/dependabot/github_actions/terrafor… #19

Merge pull request #7 from rabiloo/dependabot/github_actions/terrafor…

Merge pull request #7 from rabiloo/dependabot/github_actions/terrafor… #19

Workflow file for this run

name: Run linting
on:
- push
jobs:
lint:
runs-on: ubuntu-latest
name: Run linting
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v2
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Cache plugin dir
uses: actions/cache@v3
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- name: Run init
run: |
tflint --init
terraform init -upgrade
- name: Show version
run: |
terraform --version
tflint --version
- name: Run linting
run: |
terraform fmt --recursive
tflint -f compact --module
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Run linting