Skip to content

feat!: Add multi account support for dns and kong modules #60

feat!: Add multi account support for dns and kong modules

feat!: Add multi account support for dns and kong modules #60

name: Terraform Docs
on:
workflow_call:
pull_request:
push:
branches:
- main
permissions:
contents: write
pull-requests: write
env:
TERRAFORM_DOCS_VERSION: v0.18.0
jobs:
generateDocs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
with:
ref: ${{ github.event_name == 'pull_request' && github.head_ref || github.event.pull_request.head.ref || github.ref }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Render and Push terraform docs for main module
if: github.actor != 'dependabot[bot]'
uses: terraform-docs/gh-actions@v1.4.1
with:
working-dir: .
git-push: "true"
output-file: README.md
output-format: markdown table
output-method: replace
recursive: false
template: |
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
{{- printf "\n" -}}
args: "--header-from .header.md"
- name: Check if modules folder exists
id: check_modules
run: echo "modules_exists=$(if [ -d modules ]; then echo true; else echo false; fi)" >> $GITHUB_ENV
- name: Render and Push terraform docs for sub modules
if: env.modules_exists == 'true' && github.actor != 'dependabot[bot]'
uses: terraform-docs/gh-actions@v1.4.1
with:
working-dir: .
git-push: "true"
output-file: README.md
output-format: markdown table
output-method: replace
recursive: true
recursive-path: modules
template: |
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
{{- printf "\n" -}}
args: "--header-from .header.md"
- name: Check if examples folder exists
id: check_examples
run: echo "examples_exists=$(if [ -d examples ]; then echo true; else echo false; fi)" >> $GITHUB_ENV
- name: Render and Push terraform docs for examples
if: env.examples_exists == 'true' && github.actor != 'dependabot[bot]'
uses: terraform-docs/gh-actions@v1.4.1
with:
working-dir: .
git-push: "true"
output-file: README.md
output-format: markdown table
output-method: replace
recursive: true
recursive-path: examples
template: |
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
{{- printf "\n" -}}
args: "--header-from .header.md"