-
Notifications
You must be signed in to change notification settings - Fork 2
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(docs): Sign commits for documentation changes #257
Conversation
.github/actions/action.yml
Outdated
@@ -87,26 +87,34 @@ runs: | |||
with: | |||
ref: ${{ github.event.pull_request.head.ref }} | |||
repository: ${{ github.event.pull_request.head.repo.full_name }} | |||
- name: Check for terraform-docs.yml |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this part getting deleted? Without this, changes to any folder without a .terraform-docs.yml
will fail CI
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, okay, I definitely read this part wrong. I was simply interpreting it as "I always want to run terraform-docs
step, so I need to delete this if
check."
Sounds like I should add a terraform-docs.yml
configuration for each module in this PR, right? I guess combine this PR and #256 ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you revert the deletion of this section and restore the if: ${{ steps.tf_docs.outputs.tf_docs == 'true' }}
, then you don't need a .terraform-docs.yml
.
The logic here is "if tf-docs.yml exists in the module folder, regenerate the readme with it; otherwise do nothing"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, if I want docs automatically generated for each PR, I should add .terraform-docs.yml
right?
Follow-up question - should I make this PR only to get commit signing working (and thus, restore the if
check)? And then I can use #256 to have documentation generated automatically for all modules?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So if you want all of the modules in https://github.com/mozilla/terraform-modules/pull/256/files to get auto-readmes, they would need .teraform-docs.yml
in addition to those BEGIN_TF_DOCS
blocks.
I think you could just symlink in the .teraform-docs.yml
from the root of the repo if you want to save a little work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, reverted the if
change and this is ready for re-review!
bd61f0c
to
9fc57e3
Compare
9fc57e3
to
edfa733
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM - thanks for fixing this!
Once again I need to change a lightbulb https://www.youtube.com/watch?v=AbSehcT19u0
Our story begins with 2 small PRs:
Between these two PRs I noticed that:
The reason the generated documentation was being duplicated is because most of our README.md files are missing the block delimeters
<!-- BEGIN_TF_DOCS -->
and<!-- END_TF_DOCS -->
.So the generated content will be appended at the end of the file.
Well no worries, maybe I just need to add those blocks to our existing README.md files? #256
Close, but I think I need to add
.terraform-docs.yml
config file to every directory as well. And we need to sign the commits too! AlasSo this PR switches the README.md generation to use signed commits like #240 did.
Changelog entry