Merge branch 'main' of github.com:nanlabs/terraform-aws-starter #184
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Terraform Docs | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
tf-docs: | |
name: Generate Terraform Docs | |
runs-on: ubuntu-latest | |
if: github.event_name != 'pull_request' || !github.event.pull_request.draft | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Begin CI... | |
uses: actions/checkout@v4 | |
with: | |
# If the event that triggered the workflow is a pull request, then the variable contains ${{ github.event.pull_request.head.ref }} | |
# If the event that triggered the workflow is a push, then the variable contains ${{ github.ref }} | |
ref: ${{ github.event.pull_request.head.ref || github.ref }} | |
- name: Render terraform docs inside modules | |
uses: terraform-docs/[email protected] | |
with: | |
working-dir: modules/*,live/* | |
output-file: docs/MODULE.md | |
output-method: replace | |
git-push: "true" |