-
Notifications
You must be signed in to change notification settings - Fork 2
44 lines (39 loc) · 1.25 KB
/
docs.yml
File metadata and controls
44 lines (39 loc) · 1.25 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
name: Documentation
on:
push:
branches: ["main"]
paths:
- 'examples/**/*.tf'
- 'docs/**'
- '.github/workflows/docs.yml'
pull_request:
branches: ["main"]
paths:
- 'examples/**/*.tf'
- 'docs/**'
- '.github/workflows/docs.yml'
permissions:
contents: write
pull-requests: write
jobs:
terraform-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Generate docs for examples
uses: terraform-docs/gh-actions@v1
with:
working-dir: examples/basic,examples/flash-firmware,examples/full-provisioning,examples/talos-cluster,examples/k3s-cluster
output-file: README.md
output-method: inject
git-push: false # Don't auto-push; branch protection requires signed commits via PRs
- name: Check for uncommitted changes
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "::error::terraform-docs would update documentation. Run 'terraform-docs .' in each example directory and commit the changes."
git diff
exit 1
fi