Skip to content

.github/workflows: add workflows for linting nomad and terraform formatting #6

.github/workflows: add workflows for linting nomad and terraform formatting

.github/workflows: add workflows for linting nomad and terraform formatting #6

Workflow file for this run

name: Lint Terraform files
on:
workflow_dispatch:
pull_request:
branches:
- master
paths:
- terraform/**.tf
push:
branches:
- master
paths:
- terraform/**.tf
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint Terraform files
runs-on: ubuntu-latest
container:
image: ghcr.io/void-linux/void-glibc
steps:
- name: Prepare container
run: |
xbps-install -Syu xbps && xbps-install -y void-repo-nonfree && \
xbps-install -Syu && xbps-install -y terraform bash git diff
- name: Checkout repo
uses: classabbyamp/treeless-checkout-action@v1
- name: Run Lints
run: |
rv=0
printf "\033[1m=> Checking formatting of terraform files\033[0m\n"
terraform fmt -check -diff -recursive terraform || rv=1
exit "$rv"