Skip to content

linting

linting #50

Workflow file for this run

---
name: "Code Quality: Terraform"
on:
push:
jobs:
terraform:
name: Terraform
runs-on: ubuntu-latest
env:
# token for `a-demo-user` with access to `a-demo-organization`
GITHUB_TOKEN: "${{ secrets.TESTING_GITHUB_TOKEN }}"
strategy:
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstrategyfail-fast
fail-fast: false
matrix:
examples:
- "./examples/basic"
- "./examples/branch_protection"
- "./examples/complex"
- "./examples/deploy_keys"
- "./examples/files"
# - "./examples/issue_labels"
# - "./examples/pages"
# - "./examples/project"
# - "./examples/project_columns"
# - "./examples/template"
# - "./examples/webhook"
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Set up Terraform
uses: hashicorp/setup-terraform@v3
with:
terraform_wrapper: false
terraform_version: ${{ secrets.TERRAFORM_VERSION }}
- name: Initialize Terraform for Examples
run: terraform -chdir="${{ matrix.examples }}" init
env:
working-dir: "${{ matrix.examples }}"
- name: Format Terraform code for Module
run: terraform -chdir="${{ matrix.examples }}" fmt -check -recursive
env:
working-dir: "./"
- name: Format Terraform code for Examples
run: terraform -chdir="${{ matrix.examples }}" fmt -check -recursive
env:
working-dir: "${{ matrix.examples }}"
- name: Validate Terraform code for Examples
run: terraform -chdir="${{ matrix.examples }}" validate
env:
working-dir: "${{ matrix.examples }}"
- name: Apply Terraform code for Examples
run: terraform -chdir="${{ matrix.examples }}" apply -auto-approve
env:
working-dir: "${{ matrix.examples }}"
- name: Destructively Apply Terraform code for Examples
run: terraform -chdir="${{ matrix.examples }}" destroy -auto-approve
env:
working-dir: "${{ matrix.examples }}"