| 1 | #!/usr/bin/env bash |
| 2 | set -euo pipefail |
| 3 | |
| 4 | repo_root="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")/.." && pwd)" |
| 5 | check="$repo_root/scripts/check-docs-impact.sh" |
| 6 | |
| 7 | PR_BODY='Documentation-impact: updated - documented the new command' \ |
| 8 | "$check" internal/cli/cli.go docs/CLI.md >/dev/null |
| 9 | |
| 10 | PR_BODY='Documentation-impact: none - internal behavior keeps the existing contract' \ |
| 11 | "$check" internal/boot/boot.go >/dev/null |
| 12 | |
| 13 | PR_BODY='' "$check" internal/agent/agent_test.go >/dev/null |
| 14 | |
| 15 | if PR_BODY='' "$check" internal/cli/cli.go >/dev/null 2>&1; then |
| 16 | echo "missing documentation declaration unexpectedly passed" >&2 |
| 17 | exit 1 |
| 18 | fi |
| 19 | |
| 20 | if PR_BODY='Documentation-impact: updated - changed behavior' \ |
| 21 | "$check" internal/cli/cli.go >/dev/null 2>&1; then |
| 22 | echo "updated declaration without a docs change unexpectedly passed" >&2 |
| 23 | exit 1 |
| 24 | fi |
| 25 | |
| 26 | if PR_BODY='Documentation-impact: none' "$check" internal/cli/cli.go >/dev/null 2>&1; then |
| 27 | echo "empty none rationale unexpectedly passed" >&2 |
| 28 | exit 1 |
| 29 | fi |
| 30 | |
| 31 | echo "documentation impact contract tests: PASS" |
| 32 |