update-ops-docs.yml 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. name: Update Operations Documentation
  2. on:
  3. push:
  4. paths:
  5. - 'docs/ops.md'
  6. - 'docs/ops/**'
  7. - 'scripts/create_ops_docs.py'
  8. pull_request:
  9. paths:
  10. - 'docs/ops.md'
  11. - 'docs/ops/**'
  12. - 'scripts/create_ops_docs.py'
  13. jobs:
  14. update-ops-docs:
  15. runs-on: ubuntu-latest
  16. steps:
  17. - name: Checkout repository
  18. uses: actions/checkout@v4
  19. - name: Set up Python
  20. uses: actions/setup-python@v5
  21. with:
  22. python-version: '3.x'
  23. - name: Generate operations documentation to temporary file
  24. run: |
  25. mkdir -p /tmp/ops_check
  26. ./scripts/create_ops_docs.py /tmp/ops_check/ops.md
  27. - name: Check if docs/ops.md matches generated version
  28. run: |
  29. if ! diff -q docs/ops.md /tmp/ops_check/ops.md; then
  30. echo "Operations documentation (docs/ops.md) is not up to date with the backend CSV files."
  31. echo "To fix: run ./scripts/create_ops_docs.py and commit the updated docs/ops.md along with your changes"
  32. echo "Differences found:"
  33. diff docs/ops.md /tmp/ops_check/ops.md || true
  34. exit 1
  35. fi
  36. echo "Operations documentation is up to date."