Skip to content

Ignore archived repos, #88 #79

Ignore archived repos, #88

Ignore archived repos, #88 #79

name: "Terraform checks"
on:
pull_request:
paths-ignore:
- .gitignore
- "*.md"
- CODEOWNERS
branches:
- main
jobs:
terraform-checks:
name: "Terraform checks"
runs-on: ubuntu-latest
steps:
- name: Get pull request ref
id: sha
uses: actions/github-script@v7
with:
result-encoding: string
script: |
const { owner, repo, number } = context.issue;
const pr = await github.rest.pulls.get({
owner,
repo,
pull_number: number,
});
return pr.data.head.sha
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.sha.outputs.result }}
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3
- name: Terraform Format
id: fmt
run: terraform fmt -check -diff
- name: Terraform Init
id: init
run: terraform init -backend=false
- name: Terraform Validate
id: validate
run: terraform validate -no-color