generated from deploymenttheory/Template
-
Notifications
You must be signed in to change notification settings - Fork 1
95 lines (86 loc) · 2.86 KB
/
documentation.yml
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
name: Generate terraform docs
on:
pull_request:
branches:
- main
paths-ignore:
- '.github/**/*'
- 'scripts/**/*'
workflow_dispatch:
permissions:
contents: write # Required to update documentation in the repo
pull-requests: write
jobs:
tf-docs:
runs-on: ubuntu-latest
steps:
- name: Harden Runner
uses: step-security/harden-runner@v2.10.1
with:
egress-policy: audit
- uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.ref }}
# Creates provider documentation for registry.terraform.io
- name: Render terraform docs for microsoft365_provider
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/microsoft365_provider
indention: 3
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
- name: Render terraform docs for microsoft365_graph
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/
recursive: true
recursive-path: microsoft365_graph/
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
- name: Render terraform docs for microsoft365_graph_beta
uses: terraform-docs/gh-actions@v1.3.0
with:
working-dir: examples/
recursive: true
recursive-path: microsoft365_graph_beta/
output-file: README.md
output-method: inject
git-push: "true"
git-commit-message: "terraform-docs: automated action"
go-docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.2.2
with:
ref: ${{ github.event.pull_request.head.ref }}
# Creates provider documentation for godoc.org and pkg.go.dev
- name: Generate Go Docs
run: go generate ./...
- name: Check for changes in generated Go docs
id: go-gen-check
run: |
if [[ -n $(git status --porcelain) ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Commit changes in Go docs
if: steps.go-gen-check.outputs.changes == 'true'
uses: stefanzweifel/git-auto-commit-action@v5.0.1
with:
commit_message: "go generate: automated update"
file_pattern: '**/*.go'
commit_options: '--no-verify --signoff'
commit_user_name: "GitHub Actions Bot"
commit_user_email: "github-actions[bot]@users.noreply.github.com"
commit_author: "GitHub Actions Bot <github-actions[bot]@users.noreply.github.com>"
status_options: '--untracked-files=no'
add_options: '-u'
push_options: '--force'
skip_dirty_check: false
skip_fetch: true
skip_checkout: true