Giter Club home page Giter Club logo

find-terraform-modules's Introduction

Find Terraform Modules Action build-test

A GitHub Action that finds all Terraform module directories in a monorepo. Results can be passed to matrix jobs or looped in other steps.

Usage

name: Validate
on:
  push:
    branches: [ main ]
  pull_request:

jobs:
  find-modules:
    runs-on: ubuntu-latest
    steps:
      - id: find
        uses: bendrucker/find-terraform-modules@v1
        with:
          working-directory: ./modules
    outputs:
      modules: ${{ steps.find.outputs.modules }}
  validate:
    runs-on: ubuntu-latest
    needs: find-modules
    strategy:
      matrix:
        module: ${{ fromJson(needs.find-modules.outputs.modules) }}
    steps:
      - uses: actions/checkout@v2
      - uses: hashicorp/setup-terraform@v1
      - run: terraform fmt -check
      - run: terraform init
      - run: terraform validate -chdir ${{ matrix.module }}

Releasing

npm version $inc && git push --follow-tags

find-terraform-modules's People

Contributors

bendrucker avatar dependabot[bot] avatar kodiakhq[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

nkiraly

find-terraform-modules's Issues

Output `root-modules` with only modules that are not sourced

A user could have a monorepo full of sibling modules. Or, they could have a root module and then modules/child called in the root module. In this case, modules will return both the root and the child, but root-modules would only return the root. Some tools will want to run on all modules (e.g., TFLint) while others should only run on roots (terraform validate).

Determining root modules requires parsing the configuration to find the source value for module calls. That will probably require https://github.com/hashicorp/terraform-config-inspect and may justify converting this action to Go.

Current directory should be returned as `.`

Matrix inputs cannot accept an empty value (''). When a found dir is an empty string, . or ./ should be returned. Perhaps all relative paths should begin with ./ for consistency.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.