Skip to content

Try terraform plan

Try terraform plan #3

Workflow file for this run

name: TFLint
on:
workflow_call:
inputs:
#tf_token_keeper_path:
# required: true
# type: string
parent_tf_dir:
required: true
type: string
description: Parent directory where all Terraform files are underneath
default: "."
cli_opts:
required: false
type: string
default: " "
secrets:
GITHUB_TOKEN:

Check failure on line 19 in .github/workflows/tflint.yaml

View workflow run for this annotation

GitHub Actions / .github/workflows/tflint.yaml

Invalid workflow file

secret name `GITHUB_TOKEN` within `workflow_call` can not be used since it would collide with system reserved name
required: true
jobs:
terraform_fmt:
runs-on: self-hosted
container:
image: buildpack-deps:bookworm
steps:
- uses: actions/checkout@v4
name: Checkout source code
- name: Calculate tflint config hash
id: hash
run: |
echo "hash=$(sha256sum ${{ inputs.parent_tf_dir }}/.tflint.hcl | cut -d' ' -f1)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
name: Cache plugin dir
with:
path: ~/.tflint.d/plugins
key: selfhosted-tflint-${{ steps.hash.outputs.hash }}
- uses: terraform-linters/setup-tflint@v4
name: Setup TFLint
with:
tflint_version: latest
- name: Show version
run: |
cd ${{ inputs.parent_tf_dir }}
tflint --version
- name: Init TFLint
run: |
cd ${{ inputs.parent_tf_dir }}
tflint --init
env:
# https://github.com/terraform-linters/tflint/blob/master/docs/user-guide/plugins.md#avoiding-rate-limiting
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Run TFLint recursively
run: |
cd ${{ inputs.parent_tf_dir }}
tflint --recursive -f compact ${{ inputs.cli_opts }}