Docs CI #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Validate Documentation | |
on: | |
pull_request: | |
branches: [ main ] | |
jobs: | |
docs-check: | |
name: Check Documentation Matches Provider Schema | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22' | |
cache: true | |
- name: Install tfplugindocs | |
run: cd tools && go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs | |
- name: Generate Documentation | |
run: make gen-docs | |
- name: Check for changes in docs | |
run: | | |
DOCS_CHANGES=$(git status --porcelain docs/) | |
if [[ -n "${DOCS_CHANGES}" ]]; then | |
echo "Error: Documentation is out of sync with schema. Please run 'make gen-docs' locally and commit the changes." | |
echo "Changes detected in docs folder:" | |
echo "$DOCS_CHANGES" | |
exit 1 | |
fi |