-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
46 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# https://github.com/terraform-docs/gh-actions | ||
|
||
name: Generate Terraform-Docs | ||
on: | ||
push: | ||
branches: | ||
- '*' | ||
workflow_call: | ||
inputs: | ||
name: | ||
description: "Name on which to push changes to GitHub" | ||
required: true | ||
type: string | ||
email: | ||
description: "Email on which to push changes to GitHub" | ||
required: true | ||
type: string | ||
src_path_tf: | ||
description: "Provide dir on which to run tf-docs" | ||
required: false | ||
type: string | ||
terraform_docs_config_file: | ||
description: "Name custom tf-docs template file if existing" | ||
required: false | ||
type: string | ||
|
||
jobs: | ||
create-tf-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checking out code to Runner | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.event.pull_request.head.ref }} | ||
- name: Render Terraform-Docs | ||
uses: terraform-docs/[email protected] | ||
with: | ||
find-dir: ${{ inputs.src_path_tf}} | ||
config-file: ${{ inputs.terraform_docs_config_file }} | ||
output-file: README.md | ||
# other methods "replace" or "reprint", "inject" | ||
output-method: replace | ||
git-push: true | ||
git-commit-message: "Updating README.md via GithubActions (tf-docs)" | ||
git-push-user-email: ${{ inputs.email }} | ||
git-push-user-name: ${{ inputs.name }} |