From b84b95fe7dfc770781f1794e2c126493eec47ac2 Mon Sep 17 00:00:00 2001 From: JohT <7671054+JohT@users.noreply.github.com> Date: Thu, 30 Oct 2025 07:40:35 +0100 Subject: [PATCH 1/2] Ignore header-less Markdown files in reference generation --- .../generateJupyterReportReference.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/documentation/analysis-reports-reference/generateJupyterReportReference.sh b/documentation/analysis-reports-reference/generateJupyterReportReference.sh index 6167246d..9f9e4a62 100755 --- a/documentation/analysis-reports-reference/generateJupyterReportReference.sh +++ b/documentation/analysis-reports-reference/generateJupyterReportReference.sh @@ -24,8 +24,11 @@ echo "generateJupyterReportReference: Generating ${markdown_file}..." # Loop through all Markdown files in the current directory find . -type f -name "*.md" | sort | while read -r report_file; do - # Extract the first non-empty line that starts with '#' - report_file_header_line=$(grep -m 1 -e '^#\+.*' "${report_file}") + # Extract the first non-empty line that starts with one or more '#', allowing leading spaces + if ! report_file_header_line=$(grep -m 1 -e '^[[:space:]]*#\+[[:space:]]*.*' "${report_file}"); then + echo "generateJupyterReportReference: Warning: No header line found in ${report_file}, skipping." + continue + fi # Remove leading '#' characters and trim leading/trailing spaces description=$(echo "${report_file_header_line}" | sed -E 's/^#+\s*//') From d2f9fc7ffc1107bf77b03a371808400881d337a2 Mon Sep 17 00:00:00 2001 From: JohT <7671054+JohT@users.noreply.github.com> Date: Thu, 30 Oct 2025 07:44:11 +0100 Subject: [PATCH 2/2] Run documentation generation when its scripts changes --- .github/workflows/internal-report-reference-documentation.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/internal-report-reference-documentation.yml b/.github/workflows/internal-report-reference-documentation.yml index 75f30f93..3fa00654 100644 --- a/.github/workflows/internal-report-reference-documentation.yml +++ b/.github/workflows/internal-report-reference-documentation.yml @@ -9,6 +9,7 @@ on: - "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention) - ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed - ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed + - "documentation/analysis-reports-reference/**" # Also run when the report reference generation scripts were changed pull_request: branches: - main @@ -17,6 +18,7 @@ on: - "!analysis-results/*.md" # Ignore report reference documentation changes (endless loop prevention) - ".github/workflows/internal-report-reference-documentation.yml" # Also run when this file was changed - ".github/workflows/internal-commit-results" # Also run when the commit-results workflow was changed + - "documentation/analysis-reports-reference/**" # Also run when the report reference generation scripts were changed jobs: generate-report-reference-documentation: