https://github.com/bendrucker/find-terraform-modules
GitHub Action to find all Terraform module directories in a monorepo
https://github.com/bendrucker/find-terraform-modules
github-actions terraform
Last synced: 3 months ago
JSON representation
GitHub Action to find all Terraform module directories in a monorepo
- Host: GitHub
- URL: https://github.com/bendrucker/find-terraform-modules
- Owner: bendrucker
- License: mit
- Created: 2021-06-22T16:32:17.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2026-04-19T00:23:52.000Z (3 months ago)
- Last Synced: 2026-04-19T02:37:50.070Z (3 months ago)
- Topics: github-actions, terraform
- Language: TypeScript
- Size: 2.09 MB
- Stars: 12
- Watchers: 1
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Find Terraform Modules Action [](https://github.com/bendrucker/find-terraform-modules/actions/workflows/test.yml)
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
```yaml
name: Validate
on:
push:
branches: [ main ]
pull_request:
jobs:
find-modules:
runs-on: ubuntu-latest
steps:
- id: find
uses: bendrucker/find-terraform-modules@v2
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
```sh
npm version $inc && git push --follow-tags
```