From cf78d5d4f8666781fbf172d8f7500592f79d4cca Mon Sep 17 00:00:00 2001 From: Steven Bal Date: Tue, 23 Jul 2024 16:31:07 +0200 Subject: [PATCH] :construction_worker: [open-zaak/open-zaak#1649] Job to check if docs changed --- .github/workflows/ci.yml | 13 ++++++++++++- bin/generate_envvar_docs.sh | 4 ++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100755 bin/generate_envvar_docs.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c3d31c14..ee852374 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -64,7 +64,7 @@ jobs: - name: Publish coverage report uses: codecov/codecov-action@v3 - docs: + check-envvar-docs: runs-on: ubuntu-latest name: Documentation build @@ -75,6 +75,17 @@ jobs: python-version: '3.11' - name: Install dependencies run: pip install -r requirements/dev.txt pytest + - name: Generate environment variable documentation using OAf and check if it was updated + run: | + bin/generate_envvar_docs.sh + changes=$(git diff docs/installation/config.rst) + if [ ! -z "$changes" ]; then + echo $changes + echo "Please update the environment documentation by running \`bin/generate_envvar_docs.sh\`" + exit 1 + fi + env: + DJANGO_SETTINGS_MODULE: nrc.conf.ci - name: Build and test docs run: cd docs && pytest check_sphinx.py -v --tb=auto diff --git a/bin/generate_envvar_docs.sh b/bin/generate_envvar_docs.sh new file mode 100755 index 00000000..2a4c8aaa --- /dev/null +++ b/bin/generate_envvar_docs.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +# Generates the documentation for environment variables +src/manage.py generate_envvar_docs --file docs/installation/configuration/env_config.rst