Skip to content

Update Github Workflow #23

Update Github Workflow

Update Github Workflow #23

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 Tofu
uses: opentofu/setup-opentofu@v1
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v4
- name: Cache terraform dir
uses: actions/cache@v4
with:
path: ~/.terraform
key: terraform-${{ hashFiles('versions.tf') }}
- name: Cache tflint dir
uses: actions/cache@v4
with:
path: ~/.tflint.d
key: tflint-${{ hashFiles('.tflint.hcl') }}
- name: Show version
run: |
tofu --version
tflint --version
- name: Run init
run: |
tflint --init
tofu init -upgrade
- name: Run linting
run: |
tofu fmt --recursive
tflint -f compact --module
- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Run linting