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