Update tf_validate_task.yml #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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: | ||
- 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 }} |