Skip to content

Commit

Permalink
fix: replaced pre-commit repo docs creation/update by GH Actions
Browse files Browse the repository at this point in the history
	new file:   .github/workflows/documentation.yml
	modified:   .pre-commit-config.yaml
	new file:   .terraform-docs.yml
	modified:   README.md
  • Loading branch information
rr-epam committed Feb 21, 2024
1 parent 17755cd commit 53ef239
Show file tree
Hide file tree
Showing 4 changed files with 95 additions and 29 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Generate terraform docs
on:
pull_request:
branches:
- main
- master

jobs:
AutogenerateTerraformRepoDocs:
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"
3 changes: 0 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ repos:
hooks:
- id: terraform_fmt
- id: terraform_validate
- id: terraform_docs
args:
- '--args=--lockfile=false'
- id: terraform_tflint
args:
- '--args=--only=terraform_deprecated_interpolation'
Expand Down
48 changes: 48 additions & 0 deletions .terraform-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
formatter: "markdown table" # this is required

version: ""

header-from: "main.tf"
footer-from: ""

recursive:
enabled: false
path: modules

sections:
hide: []
show: []

content: ""

# see: https://terraform-docs.io/user-guide/configuration/output
output:
file: README.md
mode: inject
template: |-
<!-- BEGIN_TF_DOCS -->
{{ .Content }}
<!-- END_TF_DOCS -->
output-values:
enabled: false
from: ""

sort:
enabled: true
by: name

settings:
anchor: true
color: true
default: true
description: false
escape: true
hide-empty: false
html: true
indent: 2
lockfile: true
read-comments: true
required: true
sensitive: true
type: true
51 changes: 25 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,48 +64,47 @@ module "automation-runbook" {
<!-- BEGIN_TF_DOCS -->
## Requirements

| Name | Version |
| ---------------------------------------------------------------------------- | --------- |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.40.0 |
| Name | Version |
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0.0 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.40.0 |

## Providers

| Name | Version |
| ---------------------------------------------------------------------- | ------- |
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | 3.40.0 |
| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.40.0 |


## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group)| The name of the resource group | `string` | n/a | yes |
| <a name="input_location"></a> [location](#input\_location)| Azure location | `string` | n/a | yes |
| <a name="input_automation_account_name"></a> [automation\_account\_name](#input\_automation\_account\_name)| Automation Account name. | `string` | n/a | yes |
| <a name="input_runbook"></a> [runbook](#input\_runbook)| Objects with parameters to configure Runbook |<pre>object({<br> name = optional(string),<br> description = optional(string),<br> script_path = optional(string),<br> content = optional(string),<br> log_verbose = optional(bool, true),<br> log_progress = optional(bool, true),<br> runbook_type = optional(string, "PowerShellWorkflow")<br>})</pre> | n/a | no |
| <a name="input_schedules"></a> [schedules](#input\_schedules)| Set of objects with parameters to configure Schedules for Runbook. | <pre>set(object({<br> name = optional(string),<br> description = optional(string),<br> frequency = optional(string, "Week"),<br> interval = optional(string, "1"),<br> start_time = optional(string, null),<br> week_days = optional(list(string), ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"]),<br> parameters = optional(any, {})<br>}))</pre> | [] | no |
## Modules

No modules.

## Resources

| Name | Type |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- |
| [azurerm_automation_runbook.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_runbook) | resource |
| [azurerm_automation_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_schedule) | resource |
| [azurerm_automation_job_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_job_schedule) | resource |
| Name | Type |
|------|------|
| [azurerm_automation_job_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_job_schedule) | resource |
| [azurerm_automation_runbook.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_runbook) | resource |
| [azurerm_automation_schedule.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/automation_schedule) | resource |

## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| <a name="input_automation_account_name"></a> [automation\_account\_name](#input\_automation\_account\_name) | Automation Account name | `string` | n/a | yes |
| <a name="input_location"></a> [location](#input\_location) | Azure location | `string` | n/a | yes |
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group name where Automation Account is located | `string` | n/a | yes |
| <a name="input_runbook"></a> [runbook](#input\_runbook) | Objects with parameters to configure Runbook | <pre>object({<br> name = optional(string),<br> description = optional(string),<br> script_path = optional(string),<br> content = optional(string)<br> log_verbose = optional(bool, true),<br> log_progress = optional(bool, true),<br> runbook_type = optional(string, "PowerShellWorkflow")<br> })</pre> | n/a | yes |
| <a name="input_schedules"></a> [schedules](#input\_schedules) | Set of objects with parameters to configure Schedules for Runbook | <pre>set(object({<br> name = optional(string),<br> description = optional(string),<br> frequency = optional(string, "Week"),<br> interval = optional(string, "1"),<br> start_time = optional(string, null),<br> week_days = optional(list(string), ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"])<br> parameters = optional(any, {})<br> }))</pre> | `[]` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Resource tags | `map(any)` | `{}` | no |

## Outputs

| Name | Description |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| Name | Description |
|------|-------------|
| <a name="output_runbook_id"></a> [runbook\_id](#output\_runbook\_id) | Automation Runbook Id |
<!-- END_TF_DOCS -->

## License

Apache 2 Licensed. For more information please see [LICENSE](https://github.com/data-platform-hq/terraform-azurerm-automation-runbook/blob/main/LICENSE)
Apache 2 Licensed. For more information please see [LICENSE](./LICENSE)

0 comments on commit 53ef239

Please sign in to comment.