-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (38 loc) · 1022 Bytes
/
doc_sync.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
name: Doc synchronization
on:
push:
branches:
- master
pull_request:
branches:
- master
workflow_dispatch:
permissions:
contents: read
jobs:
doc-sync:
name: check if doc is generate
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: sets up go environnement
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Get dependencies
run: go mod download
- name: Install tfplugindocs
run: go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
- name: Run tfplugindocs
run: go generate ./...
- name: Fail if any files changed
shell: bash
run: |
if [[ $(git status --porcelain=v1 docs/ | wc -l) -ne 0 ]]; then
echo "Please ensure tfplugindocs changes are committed to docs/"
echo "Changed files:"
git diff docs/
git status docs/
exit 1
fi