theappnest / terraform-monorepo-action

A GitHub action to return an array of paths to Terraform modules.
12 stars 15 forks source link

terraform-monorepo-action

This GitHub action returns an array of paths to Terraform modules.

Usage

jobs:
  modules:
    runs-on: ubuntu-latest
    steps:
      - uses: theappnest/terraform-monorepo-action@master
        id: modules
        with:
          monitored: '.tpl, .hcl, .terraform.lock.hcl'
          ignore: |
            */*
            !modules/**
            modules/ignored/*
    outputs:
      modules: ${{ steps.modules.outputs.modules }}

  terraform:
    runs-on: ubuntu-latest
    needs: modules
    strategy:
      matrix:
        module: ${{ fromJson(needs.modules.outputs.modules) }}
    defaults:
      run:
        working-directory: ${{ matrix.module }}
    steps:
      - uses: actions/checkout@v2
      - uses: hashicorp/setup-terraform@v1
      - run: terraform init
      - run: terraform plan

Inputs

Outputs