Skip to content

Commit a99c6dc

Browse files
committed
config: update workflows
1 parent f7255db commit a99c6dc

File tree

5 files changed

+95
-43
lines changed

5 files changed

+95
-43
lines changed

.github/workflows/documentation.yaml

Lines changed: 0 additions & 38 deletions
This file was deleted.

.github/workflows/pre-commit.yaml renamed to .github/workflows/terrafomr-checks.yaml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Pre-Commit
1+
name: Terraform Checks
22

33
on:
44
push:
@@ -11,12 +11,30 @@ on:
1111
- master
1212

1313
env:
14-
TERRAFORM_DOCS_VERSION: v0.16.0
15-
TFLINT_VERSION: v0.50.3
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
TFLINT_VERSION: v0.52.0
1616

1717
jobs:
18+
test:
19+
name: Test
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Setup Terraform
23+
uses: hashicorp/setup-terraform@v3
24+
with:
25+
terraform_version: "1.8.4"
26+
27+
- name: Initialize Terraform
28+
id: init
29+
run: terraform init -input=false
30+
31+
- name: Terraform Test
32+
id: fmt
33+
run: terraform test
34+
1835
collectInputs:
1936
name: Collect workflow inputs
37+
needs: test
2038
runs-on: ubuntu-latest
2139
outputs:
2240
directories: ${{ steps.dirs.outputs.directories }}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Terraform Docs
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
pull_request:
9+
branches:
10+
- main
11+
- master
12+
13+
env:
14+
TERRAFORM_DOCS_VERSION: v0.18.0
15+
16+
jobs:
17+
generateDocs:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout repository
21+
uses: actions/checkout@v4
22+
with:
23+
ref: ${{ github.event.pull_request.head.ref }}
24+
25+
- name: Render and Push terraform docs for main and modules
26+
uses: terraform-docs/gh-actions@main
27+
with:
28+
working-dir: .
29+
git-push: true
30+
config-file: .terraform-docs.yaml
31+
32+
- name: Render and Push terraform docs for examples
33+
uses: terraform-docs/gh-actions@main
34+
with:
35+
working-dir: .
36+
git-push: true
37+
config-file: .terraform-docs-example.yaml

.terraform-docs-example.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
formatter: "markdown table"
2+
3+
header-from: .header.md
4+
footer-from: ""
5+
6+
recursive:
7+
enabled: true
8+
path: examples
9+
include-main: false
10+
11+
output:
12+
file: "README.md"
13+
mode: replace
14+
template: |-
15+
<!-- BEGIN_TF_DOCS -->
16+
{{ .Content }}
17+
<!-- END_TF_DOCS -->
18+
{{- printf "\n" -}}
19+
20+
sort:
21+
enabled: true
22+
by: name
23+
24+
settings:
25+
anchor: true
26+
color: true
27+
default: true
28+
description: false
29+
escape: true
30+
hide-empty: false
31+
html: true
32+
indent: 2
33+
lockfile: true
34+
read-comments: true
35+
required: true
36+
sensitive: true
37+
type: true

.terraform-docs.yml renamed to .terraform-docs.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
formatter: "markdown table"
22

3-
version: ""
4-
53
header-from: .header.md
64
footer-from: ""
75

0 commit comments

Comments
 (0)