Skip to content

Update tf_validate_task.yml #3

Update tf_validate_task.yml

Update tf_validate_task.yml #3

# .github/workflows/validate.yml
name: Terraform Validate
on:
workflow_call:
inputs:
working_directory:
required: true
type: string
backend_azure_rm_storage_account_name:
required: true
type: string
backend_azure_rm_container_name:
required: true
type: string
backend_azure_rm_key:
required: true
type: string
backend_azure_rm_resource_group_name:
required: true
type: string
jobs:
validate:
name: Validate Terraform Code
runs-on: ubuntu-latest
steps:

Check failure on line 27 in .github/workflows/tf_validate_task.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/tf_validate_task.yml

Invalid workflow file

You have an error in your yaml syntax on line 27
- name: Checkout Code
uses: actions/checkout@v3
- name: List Current Directory Contents
run: ls -la ${{ github.workspace}}
- name: List Terraform Directory Contents
run: ls -la ${{ github.workspace}}/terraform/
- name: Check Terraform Formatting
run: terraform fmt --check --diff -recursive
working-directory: ${{ inputs.working_directory }}
uses: casa-de-vops/terraform-code-standards/.github/workflows/az_login_task.yml@github_actions
secrets: inherit
with:
gh_environment: ${{ inputs.gh_environment }}
- name: Initialize Terraform
run: |
terraform init -input=false \
-backend-config="storage_account_name=${{ inputs.backend_azure_rm_storage_account_name }}" \
-backend-config="container_name=${{ inputs.backend_azure_rm_container_name }}" \
-backend-config="key=${{ inputs.backend_azure_rm_key }}" \
-backend-config="resource_group_name=${{ inputs.backend_azure_rm_resource_group_name }}"
working-directory: ${{ inputs.working_directory }}
- name: Validate Terraform
run: terraform validate
working-directory: ${{ inputs.working_directory }}