Skip to content

feat: Add the Terraform module #15

feat: Add the Terraform module

feat: Add the Terraform module #15

Workflow file for this run

# Copyright 2024 Canonical Ltd.
# See LICENSE file for licensing details.
name: Check Terraform Module
on:
pull_request:
jobs:
check-terraform:
name: Check Terraform
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./terraform
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Initialize Terraform Module
id: init
run: terraform init
- name: Validate Terraform Module
id: validate
run: terraform validate -no-color
- name: Validate terraform fmt
run: |
set +e
terraform fmt -recursive -check -diff
FMT_STATUS="$?"
if [[ "$FMT_STATUS" -ne 0 ]]; then
echo "❌ terraform fmt failed" >> "$GITHUB_STEP_SUMMARY"
fi
exit "$FMT_STATUS"