Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(test-module): support terraform-docs's output.file #1584

Merged
merged 5 commits into from
Mar 14, 2024

Conversation

suzuki-shunsuke
Copy link
Owner

@suzuki-shunsuke suzuki-shunsuke commented Mar 13, 2024

Close #1582

This pull request fixes a bug that a Module document README.md becomes empty by terraform-docs if output.file is set.

This pull request changes how to run terraform-docs as the following.

Run terraform-docs . and output the result to a temporal file.
If the output is empty, this means output.file is enabled.
If the output isn't empty, this means output.file is disabled and the generated document is outputted to the temporal file, so copy the content of the temporal file to README.md.
If README.md doesn't include <!-- BEGIN_TF_DOCS -->, copy the content of the temporal file to README.md.

@suzuki-shunsuke suzuki-shunsuke added the bug Something isn't working label Mar 13, 2024
@suzuki-shunsuke suzuki-shunsuke added this to the v1.2.3 milestone Mar 13, 2024
@suzuki-shunsuke
Copy link
Owner Author

Ignore this message.

$ terraform-docs .
README.md updated successfully

@suzuki-shunsuke suzuki-shunsuke merged commit c7dfb2d into main Mar 14, 2024
12 checks passed
@suzuki-shunsuke suzuki-shunsuke deleted the fix-support-terraform-docs-output-file branch March 14, 2024 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

modules README.md is always overwritten
1 participant