-
Notifications
You must be signed in to change notification settings - Fork 1
133 lines (110 loc) · 3.9 KB
/
ci.yml
File metadata and controls
133 lines (110 loc) · 3.9 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: ci
on:
pull_request:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set up QEMU
uses: docker/setup-qemu-action@29109295f81e9208d7d86ff1c6c12d2833863392 # v3.6.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
- name: Build Docker images
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
with:
outputs: "type=image"
platforms: linux/amd64,linux/arm64
push: false
tags: step-security/terraform-docs
- name: Should generate USAGE.md for tf11_basic
uses: ./
with:
working-dir: examples/tf11_basic
output-file: USAGE.md
template: |-
<!-- BEGIN_TF_DOCS -->
# Test tf11 basic
## Verify
Should use the template defined instead of the default
Should inject the table under usage
# Usage
{{ .Content }}
<!-- END_TF_DOCS -->
indention: 3
- name: Should generate USAGE.md for tf11_extra_args
uses: ./
with:
working-dir: examples/tf11_extra_args
output-format: markdown document
output-file: USAGE.md
output-method: replace
args: --sensitive=false --hide requirements --required=false
indention: 3
- name: Should generate README.md for tf12_bsic
uses: ./
with:
working-dir: examples/tf12_basic
indention: 3
- name: Should generate README.md for tf12_atlantis
uses: ./
with:
atlantis-file: atlantis.yaml
args: --hide providers
indention: 3
- name: Should generate USAGE.md for tf12_find and its submodules
uses: ./
with:
find-dir: examples/tf12_find
output-file: USAGE.md
- name: Should generate USAGE.md for tf12_find and its submodules recursively
uses: ./
with:
working-dir: examples/tf12_find
output-file: USAGE.md
recursive: true
recursive-path: modules
- name: Should generate README.md for tf12_config
uses: ./
with:
working-dir: examples/tf12_config
config-file: .terraform-docs.yml
- name: Should generate README.md for tf12_inject and push up all changes
uses: ./
with:
working-dir: examples/tf12_inject
args: --sort-by required
indention: 3
git-push: true
git-push-sign-off: true
git-commit-message: "terraform-docs: automated action"
- name: Should generate README.md for tf12_fail_diff and fail on diff
continue-on-error: true
uses: ./
with:
working-dir: examples/tf12_fail_diff
indention: 3
fail-on-diff: true
format:
runs-on: ubuntu-latest
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Terraform format
uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
with:
terraform_version: '0.12.17'
- run: terraform fmt examples