Skip to content

Commit ae179fa

Browse files
author
Furkhat Kasymov Genii Uulu
committed
chore: github action to check docs are updated
1 parent e01438a commit ae179fa

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Documentation Check
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
check_readme:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v4
15+
16+
- name: Setup terraform-docs
17+
uses: terraform-docs/gh-actions@v1.2.0
18+
with:
19+
working-dir: .
20+
output-file: README.md
21+
output-method: inject
22+
git-push: "false"
23+
24+
- name: Check if README.md is up-to-date
25+
run: |
26+
make generate-doc
27+
if [ -n "$(git status --porcelain)" ]; then
28+
echo "ERROR: README.md is not up-to-date. Run 'make generate-doc' locally and commit the changes."
29+
echo
30+
git diff
31+
echo
32+
git status
33+
exit 1
34+
fi
35+
echo "README.md is up-to-date!"

0 commit comments

Comments
 (0)