Skip to content

Merge pull request #9 from rabiloo/dependabot/github_actions/hashicor… #21

Merge pull request #9 from rabiloo/dependabot/github_actions/hashicor…

Merge pull request #9 from rabiloo/dependabot/github_actions/hashicor… #21

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@v3
- 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@v5
with:
commit_message: Run linting