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: 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*//')