added create_instance_profile conditional #72
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
name: Pre-Commit | |
'on': | |
pull_request: null | |
push: | |
branches: | |
- main | |
env: | |
TERRAFORM_DOCS_VERSION: v0.16.0 | |
TFLINT_VERSION: v0.50.3 | |
jobs: | |
compositeInputs: | |
name: Collect workflow inputs | |
runs-on: ubuntu-latest | |
outputs: | |
directories: '${{ steps.dirs.outputs.directories }}' | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Get root directories | |
id: dirs | |
uses: clowdhaus/terraform-composite-actions/directories@v1.9.0 | |
preCommitMinVersions: | |
name: Min TF pre-commit | |
needs: compositeInputs | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
directory: '${{ fromJson(needs.compositeInputs.outputs.directories) }}' | |
steps: | |
- name: Delete huge unnecessary tools folder | |
run: | | |
rm -rf /opt/hostedtoolcache/CodeQL | |
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk | |
rm -rf /opt/hostedtoolcache/Ruby | |
rm -rf /opt/hostedtoolcache/go | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Terraform min/max versions | |
id: minMax | |
uses: clowdhaus/terraform-min-max@v1.3.0 | |
with: | |
directory: '${{ matrix.directory }}' | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: latest | |
- name: Initialize Terraform | |
run: terraform init | |
- name: 'Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}' | |
if: '${{ matrix.directory != ''.'' }}' | |
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 | |
with: | |
terraform-version: '${{ steps.minMax.outputs.minVersion }}' | |
tflint-version: '${{ env.TFLINT_VERSION }}' | |
- name: 'Pre-commit Terraform ${{ steps.minMax.outputs.minVersion }}' | |
if: '${{ matrix.directory == ''.'' }}' | |
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 | |
with: | |
terraform-version: '${{ steps.minMax.outputs.minVersion }}' | |
tflint-version: '${{ env.TFLINT_VERSION }}' | |
preCommitMaxVersion: | |
name: Max TF pre-commit | |
runs-on: ubuntu-latest | |
needs: compositeInputs | |
steps: | |
- name: Delete huge unnecessary tools folder | |
run: | | |
rm -rf /opt/hostedtoolcache/CodeQL | |
rm -rf /opt/hostedtoolcache/Java_Temurin-Hotspot_jdk | |
rm -rf /opt/hostedtoolcache/Ruby | |
rm -rf /opt/hostedtoolcache/go | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
ref: '${{ github.event.pull_request.head.ref }}' | |
repository: '${{github.event.pull_request.head.repo.full_name}}' | |
- name: Terraform min/max versions | |
id: minMax | |
uses: clowdhaus/terraform-min-max@v1.3.0 | |
- name: Set up Terraform | |
uses: hashicorp/setup-terraform@v3 | |
with: | |
terraform_version: latest | |
- name: Initialize Terraform | |
run: terraform init | |
- name: 'Pre-commit Terraform ${{ steps.minMax.outputs.maxVersion }}' | |
uses: clowdhaus/terraform-composite-actions/pre-commit@v1.9.0 | |
with: | |
terraform-version: '${{ steps.minMax.outputs.maxVersion }}' | |
tflint-version: '${{ env.TFLINT_VERSION }}' | |
terraform-docs-version: '${{ env.TERRAFORM_DOCS_VERSION }}' | |
install-hcledit: true |