Merge pull request #9 from rabiloo/dependabot/github_actions/hashicor… #21
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |