-
Notifications
You must be signed in to change notification settings - Fork 1
92 lines (90 loc) · 2.93 KB
/
terraform-docs.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
---
'on':
workflow_call:
inputs:
config_file:
default: '.terraform-docs.yml'
description: The path to the configuration file.
required: false
type: string
git_push:
default: false
description: If set to true, push the changes to the repository.
required: false
type: boolean
jobs_run_on:
default: ubuntu-latest
description: The runner group on which jobs will run.
required: false
type: string
output_file:
default: 'README.md'
description: The path to the output file.
required: false
type: string
output_method:
default: 'inject'
description: The method to use for output.
required: false
type: string
terragrunt_directory:
default: 'prod'
description: The environment directory from which Terragrunt should run.
required: false
type: string
timeout_minutes:
default: 5
description: The maximum time (in minutes) for a job to run.
required: false
type: number
use_terragrunt:
default: false
description: If set to true, use Terragrunt instead of Terraform.
required: false
type: boolean
working_directory:
default: '.'
description: |
The working directory where all jobs should be executed.
Comma separated list of directories to generate docs for.
required: false
type: string
jobs:
terraform-docs:
defaults:
run:
working-directory: ${{ inputs.working_directory }}
if: ${{ !inputs.use_terragrunt && github.actor != 'dependabot[bot]' }}
runs-on: ${{ inputs.jobs_run_on }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Render terraform docs inside the README.md
uses: terraform-docs/[email protected]
with:
config-file: ${{ inputs.config_file }}
git-push: ${{ inputs.git_push }}
output-file: ${{ inputs.output_file }}
output-method: ${{ inputs.output_method }}
working-dir: ${{ inputs.working_directory }}
timeout-minutes: ${{ inputs.timeout_minutes }}
terragrunt-docs:
defaults:
run:
working-directory: ${{ inputs.working_directory }}
env:
DISABLE_INIT: true
if: ${{ inputs.use_terragrunt && github.actor != 'dependabot[bot]' }}
runs-on: ${{ inputs.jobs_run_on }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Render terraform docs inside the README.md
uses: terraform-docs/[email protected]
with:
config-file: ${{ inputs.config_file }}
git-push: ${{ inputs.git_push }}
output-file: ${{ inputs.output_file }}
output-method: ${{ inputs.output_method }}
working-dir: ${{ inputs.working_directory }}
timeout-minutes: ${{ inputs.timeout_minutes }}