Skip to content

Github action to list all Terraform modules find in a directory to inject it on a markdown file.

License

Notifications You must be signed in to change notification settings

equisoft-devops/terraform-modules-lister

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

terraform-modules-lister

List all modules in the repository and insert that on the markdown file.

Example

name: Generate terraform docs

on:
  pull_request:
    types: [opened, synchronize, reopened, ready_for_review]

jobs:
  docs:
    runs-on: ubuntu-latest
    steps:
    - uses: actions/checkout@v3
      with:
        fetch-depth: 0
        token: ${{ secrets.PAT }}
    - name: Terraform modules lister
      uses: equisoft-devops/[email protected]
      with:
        find-dir: modules/
        output-file: README.md
    - uses: stefanzweifel/git-auto-commit-action@v4
      with:
        commit_message: "terraform-modules-lister: automated action"

This will insert the list of module into the README.md file between label <!-- BEGIN_TF_MODULES --> and <!-- END_TF_MODULES -->.

Arguments

Name Default Description
find-dir . Relative path to the base directory name where to find modules.
output-file README.md File name to insert the modules list
tag-suffix MODULES Customize the label to search in the output-file. For example, AWS will search for <!-- BEGIN_TF_AWS --> and <!-- END_TF_AWS -->.

About

Github action to list all Terraform modules find in a directory to inject it on a markdown file.

Topics

Resources

License

Stars

Watchers

Forks

Languages