feat(ci): ensure docs are up-to-date on PRs (#767)

relates to STACKITTPR-153
This commit is contained in:
Ruben Hönle 2025-04-08 10:24:19 +02:00 committed by GitHub
parent c41d61cdc4
commit 37754e865d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 33 additions and 2 deletions

21
scripts/check-docs.sh Executable file
View file

@ -0,0 +1,21 @@
#!/bin/bash
# This script is used to ensure for PRs the docs are up-to-date via the CI pipeline
# Usage: ./check-docs.sh
set -eo pipefail
ROOT_DIR=$(git rev-parse --show-toplevel)
before_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')
# re-generate the docs
$ROOT_DIR/scripts/tfplugindocs.sh
after_hash=$(find docs -type f -exec sha256sum {} \; | sort | sha256sum | awk '{print $1}')
if [[ "$before_hash" == "$after_hash" ]]; then
echo "Docs are up-to-date"
else
echo "Changes detected. Docs are *not* up-to-date."
exit 1
fi