mirror of
https://github.com/terraform-docs/terraform-docs.git
synced 2026-03-27 04:48:33 +07:00
Prepend any type of resource, including `resource`, `data`, `module`, `variable`, and `output` with a comment including "terraform-docs-ignore" to exclude it from the generated output. Signed-off-by: Khosrow Moossavi <khos2ow@gmail.com>
40 lines
889 B
Markdown
40 lines
889 B
Markdown
---
|
|
title: "GitHub Action"
|
|
description: "How to use terraform-docs with GitHub Actions"
|
|
menu:
|
|
docs:
|
|
parent: "how-to"
|
|
weight: 209
|
|
toc: false
|
|
---
|
|
|
|
To use terraform-docs GitHub Action, configure a YAML workflow file (e.g.
|
|
`.github/workflows/documentation.yml`) with the following:
|
|
|
|
```yaml
|
|
name: Generate terraform docs
|
|
on:
|
|
- pull_request
|
|
|
|
jobs:
|
|
docs:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.ref }}
|
|
|
|
- name: Render terraform docs and push changes back to PR
|
|
uses: terraform-docs/gh-actions@main
|
|
with:
|
|
working-dir: .
|
|
output-file: README.md
|
|
output-method: inject
|
|
git-push: "true"
|
|
```
|
|
|
|
Read more about [terraform-docs GitHub Action] and its configuration and
|
|
examples.
|
|
|
|
[terraform-docs GitHub Action]: https://github.com/terraform-docs/gh-actions
|