Skip to content

Update step-security/harden-runner action to v2.13.3 #74

Update step-security/harden-runner action to v2.13.3

Update step-security/harden-runner action to v2.13.3 #74

name: Terraform Checks
on:
push:
branches-ignore:
- main
paths:
- .github/workflows/terraform-*.yaml
- terraform/*.tf*
pull_request:
branches:
- main
paths:
- .github/workflows/terraform-*.yaml
- terraform/*.tf*
jobs:
lint:
name: Terraform Lint
runs-on: ubuntu-24.04
permissions:
id-token: write
contents: read
defaults:
run:
shell: bash
steps:
- name: Harden Runner
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout source code
uses: actions/checkout@v5
- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v5
with:
role-to-assume: ${{ vars.TERRAFORM_STATE_ROLE }}
aws-region: eu-west-1
- name: TFLint Cache
uses: actions/cache@v4
with:
path: ~/.tflint.d/plugins
key: tflint-${{ hashFiles('.tflint.hcl') }}
- name: Setup TFLint
uses: terraform-linters/setup-tflint@v5
with:
tflint_version: v0.52.0
- name: Init TFLint
run: tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ github.token }}
- name: Run TFLint
run: tflint --format compact --recursive --config ${PWD}/.tflint.hcl
fmt:
name: Terraform Format
runs-on: ubuntu-24.04
defaults:
run:
shell: bash
working-directory: ./terraform
steps:
- name: Harden Runner
uses: step-security/harden-runner@df199fb7be9f65074067a9eb93f12bb4c5547cf2 # v2.13.3
with:
egress-policy: audit
- name: Checkout source code
uses: actions/checkout@v5
- name: Terraform Setup
uses: hashicorp/setup-terraform@v3
with:
terraform_version: 1.13.3
- name: Terraform Format
run: terraform fmt -check -diff
continue-on-error: true