Skip to content

Commit

Permalink
Merge pull request #6 from HENNGE/update-gha
Browse files Browse the repository at this point in the history
Update gha
  • Loading branch information
FurqanHabibi authored Nov 11, 2022
2 parents a618422 + 1780f0d commit fd4bfa3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
37 changes: 22 additions & 15 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,32 @@
name: lint

on: [push, pull_request]
on:
pull_request:
push:
branches:
- main

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Run pre-commit test
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.x
- name: Install pre-commit dependency - terraform-docs
run: |
sudo apt-get install python3-pip gawk
curl https://pre-commit.com/install-local.py | python3 -
# Terraform Docs
curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/v0.9.1/terraform-docs-v0.9.1-$(uname | tr '[:upper:]' '[:lower:]')-amd64
chmod +x ./terraform-docs
sudo mv ./terraform-docs /usr/bin/terraform-docs
# Tflint
curl -L "$(curl -s https://api.github.com/repos/terraform-linters/tflint/releases/latest | grep -o -E "https://.+?_linux_amd64.zip")" > tflint.zip && unzip tflint.zip && rm tflint.zip && sudo mv tflint /usr/bin/
# Run pre-commit
/home/runner/bin/pre-commit --version
terraform-docs --version
/home/runner/bin/pre-commit run -a
TF_DOCS_VER="v0.9.1"
pushd /tmp
curl -Lo ./terraform-docs https://github.com/terraform-docs/terraform-docs/releases/download/${TF_DOCS_VER}/terraform-docs-${TF_DOCS_VER}-$(uname | tr '[:upper:]' '[:lower:]')-amd64 && chmod +x ./terraform-docs && sudo mv ./terraform-docs /usr/bin/
popd
- name: Install pre-commit dependency - tflint
uses: terraform-linters/setup-tflint@v2
with:
tflint_version: v0.34.0
- name: Run pre-commit test
uses: pre-commit/[email protected]
with:
extra_args: --all-files
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
repos:
- repo: git://github.com/antonbabenko/pre-commit-terraform
- repo: https://github.com/antonbabenko/pre-commit-terraform
rev: v1.43.0
hooks:
- id: terraform_fmt
Expand Down

0 comments on commit fd4bfa3

Please sign in to comment.